Use JS ESLint configs instead of JSON
This is to avoid ERR_IMPORT_ASSERTION_TYPE_MISSING on recent Node.js with updated ESLint. Fixes errors like the following: ".eslintrc.es6.json" needs an import assertion of type "json" [MAILPOET-5061]
This commit is contained in:
34
packages/js/eslint-config/.eslintrc-premium.js
Normal file
34
packages/js/eslint-config/.eslintrc-premium.js
Normal file
@ -0,0 +1,34 @@
|
||||
module.exports = {
|
||||
extends: ['airbnb', 'plugin:react/jsx-runtime', 'prettier'],
|
||||
env: {
|
||||
browser: true,
|
||||
},
|
||||
parser: '@babel/eslint-parser',
|
||||
parserOptions: {
|
||||
ecmaVersion: 6,
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
},
|
||||
plugins: ['react-hooks'],
|
||||
settings: {
|
||||
'import/resolver': 'webpack',
|
||||
},
|
||||
rules: {
|
||||
'class-methods-use-this': 0,
|
||||
// React hooks rules
|
||||
'react-hooks/rules-of-hooks': 'error',
|
||||
'react-hooks/exhaustive-deps': 'warn',
|
||||
'import/prefer-default-export': 0, // we want to stop using default exports and start using named exports
|
||||
// Exceptions
|
||||
'import/extensions': 0, // we wouldn't be able to import jQuery without this line
|
||||
'jsx-a11y/anchor-is-valid': [
|
||||
'error',
|
||||
{
|
||||
components: ['Link'],
|
||||
specialLink: ['to'],
|
||||
},
|
||||
],
|
||||
'import/no-default-export': 1, // no default exports
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user