|
module.exports = { |
|
env: { |
|
browser: true, |
|
es2021: true, |
|
node: true, |
|
commonjs: true, |
|
es6: true, |
|
}, |
|
extends: ['prettier'], |
|
parser: '@typescript-eslint/parser', |
|
parserOptions: { |
|
ecmaVersion: 'latest', |
|
sourceType: 'module', |
|
ecmaFeatures: { |
|
jsx: true, |
|
}, |
|
}, |
|
plugins: ['react', 'react-hooks', '@typescript-eslint'], |
|
rules: { |
|
'react/react-in-jsx-scope': 'off', |
|
indent: ['error', 2, { SwitchCase: 1 }], |
|
'max-len': [ |
|
'error', |
|
{ |
|
code: 150, |
|
ignoreStrings: true, |
|
ignoreTemplateLiterals: true, |
|
ignoreComments: true, |
|
}, |
|
], |
|
'linebreak-style': 0, |
|
|
|
|
|
'no-console': 'off', |
|
'import/extensions': 'off', |
|
'no-promise-executor-return': 'off', |
|
'no-param-reassign': 'off', |
|
'no-continue': 'off', |
|
'no-restricted-syntax': 'off', |
|
'react/prop-types': ['off'], |
|
'react/display-name': ['off'], |
|
}, |
|
overrides: [ |
|
{ |
|
files: ['**/*.ts', '**/*.tsx, **/*.js, **/*.jsx'], |
|
rules: { |
|
'no-unused-vars': 'off', |
|
'react/display-name': 'off', |
|
'@typescript-eslint/no-unused-vars': 'warn', |
|
}, |
|
}, |
|
{ |
|
files: ['rollup.config.js', '.eslintrc.js', 'jest.config.js'], |
|
env: { |
|
node: true, |
|
}, |
|
}, |
|
{ |
|
files: [ |
|
'**/*.test.js', |
|
'**/*.test.jsx', |
|
'**/*.test.ts', |
|
'**/*.test.tsx', |
|
'**/*.spec.js', |
|
'**/*.spec.jsx', |
|
'**/*.spec.ts', |
|
'**/*.spec.tsx', |
|
'setupTests.js', |
|
], |
|
env: { |
|
jest: true, |
|
node: true, |
|
}, |
|
rules: { |
|
'react/display-name': 'off', |
|
'react/prop-types': 'off', |
|
'react/no-unescaped-entities': 'off', |
|
}, |
|
}, |
|
], |
|
settings: { |
|
react: { |
|
createClass: 'createReactClass', |
|
|
|
pragma: 'React', |
|
fragment: 'Fragment', |
|
version: 'detect', |
|
}, |
|
}, |
|
}; |
|
|