2017-06-03 02:55:23 +08:00
|
|
|
module.exports = {
|
2023-09-06 22:24:09 +08:00
|
|
|
extends: 'airbnb',
|
2021-04-10 02:02:18 +08:00
|
|
|
parserOptions: {
|
|
|
|
ecmaVersion: 2020,
|
|
|
|
},
|
2023-08-15 04:52:35 +08:00
|
|
|
plugins: ['react', 'jsx-a11y', 'import'],
|
2021-04-10 02:02:18 +08:00
|
|
|
env: {
|
|
|
|
es6: true,
|
|
|
|
node: true,
|
|
|
|
browser: true,
|
|
|
|
meteor: true,
|
|
|
|
jasmine: true,
|
|
|
|
},
|
2023-09-06 22:24:09 +08:00
|
|
|
rules: {
|
|
|
|
'no-underscore-dangle': 0,
|
|
|
|
'import/extensions': [2, 'never'],
|
|
|
|
'import/no-absolute-path': 0,
|
|
|
|
'import/no-unresolved': 0,
|
|
|
|
'import/no-extraneous-dependencies': 1,
|
|
|
|
'react/prop-types': 1,
|
|
|
|
'jsx-a11y/no-access-key': 0,
|
|
|
|
'react/jsx-props-no-spreading': 'off',
|
|
|
|
'max-classes-per-file': ['error', 2],
|
|
|
|
},
|
|
|
|
globals: {
|
|
|
|
browser: 'writable',
|
|
|
|
},
|
|
|
|
overrides: [
|
|
|
|
{
|
|
|
|
files: ['*.ts', '*.tsx'],
|
2023-10-07 01:12:42 +08:00
|
|
|
extends: ['airbnb', 'eslint:recommended', 'plugin:@typescript-eslint/recommended'],
|
2023-09-06 22:24:09 +08:00
|
|
|
parser: '@typescript-eslint/parser',
|
|
|
|
plugins: ['@typescript-eslint'],
|
|
|
|
rules: {
|
2023-10-07 01:12:42 +08:00
|
|
|
'@typescript-eslint/ban-ts-comment': 'off',
|
|
|
|
camelcase: 'off',
|
2023-09-06 22:24:09 +08:00
|
|
|
'no-use-before-define': 'off',
|
2023-09-13 22:31:20 +08:00
|
|
|
'arrow-body-style': 'off',
|
|
|
|
'no-shadow': 'off',
|
2023-09-06 22:24:09 +08:00
|
|
|
'import/no-absolute-path': 0,
|
|
|
|
'import/no-unresolved': 0,
|
|
|
|
'no-unused-vars': 0, // https://stackoverflow.com/a/63767419
|
|
|
|
'import/extensions': [2, 'never'],
|
2023-09-13 22:35:56 +08:00
|
|
|
'react/sort-comp': [0],
|
2023-09-06 22:24:09 +08:00
|
|
|
'react/jsx-filename-extension': ['error', { extensions: ['.tsx', '.jsx'] }],
|
|
|
|
'max-len': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
code: 120, // Maximum line length (characters)
|
|
|
|
tabWidth: 2, // Number of spaces per tab
|
|
|
|
ignoreUrls: true, // Ignore long URLs
|
|
|
|
ignoreStrings: true, // Ignore long strings
|
|
|
|
},
|
2023-09-06 21:37:34 +08:00
|
|
|
],
|
|
|
|
},
|
2023-09-06 22:24:09 +08:00
|
|
|
},
|
|
|
|
],
|
2017-06-03 02:55:23 +08:00
|
|
|
};
|