Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Consolidate JS and TS configs (#42)"
This reverts commit 11726e6. The functionality that enables this consolidation seems to be broken. See eslint/eslint#12032
- Loading branch information
1 parent
f0e6106
commit 77a7e87
Showing
15 changed files
with
192 additions
and
170 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 +1 @@ | ||
extends: '.' | ||
extends: './javascript.js' |
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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,133 +1,28 @@ | ||
module.exports = { | ||
extends: ['airbnb', 'airbnb/hooks', 'prettier', 'prettier/react'], | ||
plugins: ['prettier'], | ||
parser: 'babel-eslint', | ||
env: { | ||
// allow browser globals | ||
browser: true, | ||
}, | ||
extends: [ | ||
require.resolve('./javascript'), | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:import/typescript', | ||
'prettier/@typescript-eslint', | ||
], | ||
rules: { | ||
// https://github.com/prettier/eslint-config-prettier#arrow-body-style-and-prefer-arrow-callback | ||
'arrow-body-style': [2, 'as-needed', {requireReturnForObjectLiteral: false}], | ||
|
||
// ensure that default, named, and namespaced imports have been exported by the target file | ||
'import/default': 2, | ||
'import/namespace': [2, {allowComputed: true}], | ||
|
||
// require import groups to be ordered by specificity and separated by linebreaks | ||
'import/order': [2, {'newlines-between': 'always'}], | ||
|
||
// allow non-ID-linked <label>s to accomodate those containing linked <input>s | ||
'jsx-a11y/label-has-for': 0, | ||
'jsx-a11y/label-has-associated-control': [2, {assert: 'either'}], | ||
|
||
// allow event listeners on static elements (e.g. onClick on divs) | ||
'jsx-a11y/no-static-element-interactions': 0, | ||
|
||
// https://github.com/prettier/eslint-config-prettier#arrow-body-style-and-prefer-arrow-callback | ||
'prefer-arrow-callback': [2, {allowNamedFunctions: false, allowUnboundThis: true}], | ||
|
||
'prettier/prettier': [ | ||
// upgrade severity from warning to error | ||
'@typescript-eslint/explicit-function-return-type': [ | ||
2, | ||
{ | ||
printWidth: 100, | ||
semi: false, | ||
singleQuote: true, | ||
trailingComma: 'es5', | ||
bracketSpacing: false, | ||
}, | ||
{allowExpressions: true, allowTypedFunctionExpressions: true}, | ||
], | ||
|
||
// disallow .jsx files for consistency | ||
'react/jsx-filename-extension': 0, | ||
|
||
// allow function creation in render | ||
'react/jsx-no-bind': 0, | ||
|
||
// do not require default props for optional props | ||
'react/require-default-props': 0, | ||
|
||
'react/sort-comp': [ | ||
2, | ||
{ | ||
order: [ | ||
'lifecycle-statics', | ||
'static-methods', | ||
'constructor', | ||
'instance-variables', | ||
'lifecycle-methods', | ||
'everything-else', | ||
'render', | ||
], | ||
groups: { | ||
'lifecycle-statics': [ | ||
'displayName', | ||
'propTypes', | ||
'contextTypes', | ||
'childContextTypes', | ||
'defaultProps', | ||
], | ||
'lifecycle-methods': [ | ||
'state', | ||
'getChildContext', | ||
'getDerivedStateFromProps', | ||
'componentWillMount', | ||
'UNSAFE_componentWillMount', | ||
'componentDidMount', | ||
'componentWillReceiveProps', | ||
'UNSAFE_componentWillReceiveProps', | ||
'shouldComponentUpdate', | ||
'componentWillUpdate', | ||
'UNSAFE_componentWillUpdate', | ||
'getSnapshotBeforeUpdate', | ||
'componentDidUpdate', | ||
'componentDidCatch', | ||
'componentWillUnmount', | ||
], | ||
}, | ||
}, | ||
], | ||
|
||
// permit both styles of state declaration | ||
'react/state-in-constructor': 0, | ||
|
||
// require statics to be declared as public fields | ||
'react/static-property-placement': [2, 'static public field'], | ||
}, | ||
settings: { | ||
// do not attempt to parse npm modules or non-JS files for exports | ||
'import/ignore': ['node_modules', '.(png|svg|jpg|css|pdf)$'], | ||
'import/extensions': ['.js'], | ||
react: {version: '16.8.1'}, | ||
'@typescript-eslint/no-explicit-any': 2, | ||
|
||
// these are checked by the TS compiler | ||
'@typescript-eslint/no-unused-vars': 0, | ||
'import/default': 0, | ||
'import/named': 0, | ||
'import/namespace': 0, | ||
'react/forbid-prop-types': 0, | ||
'react/jsx-no-undef': 0, | ||
'react/no-unused-prop-types': 0, | ||
'react/prop-types': 0, | ||
'react/react-in-jsx-scope': 0, | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['*.ts', '*.tsx'], | ||
extends: [ | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:import/typescript', | ||
'prettier/@typescript-eslint', | ||
], | ||
rules: { | ||
// upgrade severity from warning to error | ||
'@typescript-eslint/explicit-function-return-type': [ | ||
2, | ||
{allowExpressions: true, allowTypedFunctionExpressions: true}, | ||
], | ||
'@typescript-eslint/no-explicit-any': 2, | ||
|
||
// these are checked by the TS compiler | ||
'@typescript-eslint/no-unused-vars': 0, | ||
'import/default': 0, | ||
'import/named': 0, | ||
'import/namespace': 0, | ||
'react/forbid-prop-types': 0, | ||
'react/jsx-no-undef': 0, | ||
'react/no-unused-prop-types': 0, | ||
'react/prop-types': 0, | ||
'react/react-in-jsx-scope': 0, | ||
}, | ||
}, | ||
], | ||
} |
Oops, something went wrong.