This repository has been archived by the owner on Nov 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #329 from votingworks/eslint-all-the-things
feat: Deprecate tslint and eslint all the things.
- Loading branch information
Showing
54 changed files
with
1,335 additions
and
556 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/build | ||
/cypress/plugins | ||
/cypress/integration/examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
const jsExtensions = ['.js', '.jsx'] | ||
const tsExtensions = ['.ts', '.tsx'] | ||
const allExtensions = jsExtensions.concat(tsExtensions) | ||
|
||
module.exports = { | ||
env: { | ||
browser: true, | ||
node: true, | ||
es6: true, | ||
'jest/globals': true, | ||
'cypress/globals': true, | ||
}, | ||
parser: '@typescript-eslint/parser', // Specifies the ESLint parser | ||
extends: [ | ||
'airbnb', | ||
'plugin:import/errors', | ||
'plugin:import/warnings', | ||
'plugin:import/typescript', | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from @typescript-eslint/eslint-plugin | ||
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier | ||
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. | ||
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react | ||
'plugin:jsx-a11y/recommended', | ||
'prettier/react', // Overrides some of the rules in 'airbnb' to have more relaxed formatting in react. | ||
'plugin:cypress/recommended', | ||
], | ||
globals: { | ||
Atomics: 'readonly', | ||
SharedArrayBuffer: 'readonly', | ||
// fetch: true, // required if using via 'jest-fetch-mock' | ||
fetchMock: true, // required if using via 'jest-fetch-mock' | ||
}, | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
ecmaVersion: 2018, | ||
project: './tsconfig.json', | ||
sourceType: 'module', | ||
}, | ||
plugins: [ | ||
'@typescript-eslint', | ||
'jest', | ||
'no-null', | ||
'react', | ||
'cypress', | ||
'jsx-a11y', | ||
], | ||
settings: { | ||
react: { | ||
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use | ||
}, | ||
'import/extensions': allExtensions, | ||
'import/parsers': { | ||
'@typescript-eslint/parser': tsExtensions, | ||
}, | ||
'import/resolver': { | ||
node: { | ||
extensions: allExtensions, | ||
}, | ||
}, | ||
}, | ||
rules: { | ||
'@typescript-eslint/explicit-function-return-type': 'off', // Want to use it, but it requires return types for all built-in React lifecycle methods. | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
'@typescript-eslint/no-null-keyword': 'on', | ||
camelcase: 'error', | ||
'import/no-extraneous-dependencies': [ | ||
'error', | ||
{ | ||
devDependencies: true, | ||
}, | ||
], | ||
'no-null/no-null': 2, // TypeScript with strictNullChecks | ||
'react/destructuring-assignment': 'off', | ||
'react/jsx-boolean-value': [2, 'never'], | ||
'react/jsx-filename-extension': [ | ||
1, | ||
{ | ||
extensions: ['.js', '.jsx', '.ts', '.tsx'], | ||
}, | ||
], | ||
strict: 0, | ||
}, | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
proseWrap: 'always', | ||
semi: false, | ||
singleQuote: true, | ||
trailingComma: 'es5', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
processors: ['stylelint-processor-styled-components'], | ||
extends: [ | ||
'stylelint-config-palantir', | ||
'stylelint-config-prettier', | ||
'stylelint-config-styled-components', | ||
], | ||
rules: { | ||
'selector-max-id': 1, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,33 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"editor.tabSize": 2, | ||
"files.autoSave": "onFocusChange", | ||
"eslint.packageManager": "yarn", | ||
"prettier.eslintIntegration": true, | ||
"prettier.tslintIntegration": true | ||
"eslint.autoFixOnSave": true, | ||
"eslint.validate": [ | ||
"javascript", | ||
"javascriptreact", | ||
{ | ||
"language": "typescript", | ||
"autoFix": true | ||
}, | ||
{ | ||
"language": "typescriptreact", | ||
"autoFix": true | ||
} | ||
], | ||
"editor.formatOnSave": true, | ||
"[javascript]": { | ||
"editor.formatOnSave": false | ||
}, | ||
"[javascriptreact]": { | ||
"editor.formatOnSave": false | ||
}, | ||
"[typescript]": { | ||
"editor.formatOnSave": false | ||
}, | ||
"[typescriptreact]": { | ||
"editor.formatOnSave": false | ||
}, | ||
"css.validate": false, | ||
"less.validate": false, | ||
"scss.validate": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.