-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Expand file tree
/
Copy patheslint.config.mjs
More file actions
83 lines (75 loc) · 3.13 KB
/
Copy patheslint.config.mjs
File metadata and controls
83 lines (75 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import chaiFriendly from 'eslint-plugin-chai-friendly';
import globals from 'globals';
import eslintConfigPrettier from 'eslint-config-prettier/flat';
// import { importX } from 'eslint-plugin-import-x';
export default [
eslintConfigPrettier, // Disable Prettier-handled style rules - prettier owns styling
{
ignores: ['tmp/**', 'tmp'],
plugins: {
'chai-friendly': chaiFriendly,
// import: importX,
},
languageOptions: {
globals: {
...globals.node,
...globals.mocha,
...globals.browser,
},
sourceType: 'module',
},
rules: {
// Plugin-specific rules
'chai-friendly/no-unused-expressions': 'error',
// Import rules removed with temporary removal of eslint-plugin-import / eslint-plugin-import-x due to
// ESLint 10 compatibility issues, and to be added once eslint-plugin-import/-x is updated to support ESLint 10
// 'import/no-unresolved': ['error', { commonjs: true, caseSensitive: true }],
// 'import/extensions': ['error', 'ignorePackages', { js: 'never', mjs: 'never', jsx: 'never' }],
// 'import/order': ['error', { groups: [['builtin', 'external', 'internal']], distinctGroup: true }],
// 'import/no-duplicates': 'error',
// 'import/prefer-default-export': 'error',
//'import/no-named-as-default': 'error',
// 'import/no-named-as-default-member': 'error',
// Quality rules (Airbnb-style, non-style)
'class-methods-use-this': 'error',
//'consistent-return': 'error',
'default-case': 'error',
'default-param-last': 'error',
'dot-location': ['error', 'property'],
'no-cond-assign': ['error', 'except-parens'],
'no-constant-condition': 'error',
'no-constructor-return': 'error',
'no-empty-function': ['error', { allow: ['arrowFunctions'] }],
//'no-param-reassign': ['error', { props: true }],
//'no-shadow': ['error', { builtinGlobals: false }],
'no-throw-literal': 'error',
'no-useless-concat': 'error',
'prefer-const': 'error',
'prefer-destructuring': ['error', { object: true, array: false }],
yoda: ['error', 'never'],
'no-use-before-define': ['error', { functions: false, classes: true, variables: true }],
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
// Logic and safety
'global-require': 'error',
strict: ['error', 'never'],
'arrow-body-style': ['error', 'as-needed'],
'arrow-parens': ['error', 'always'],
curly: ['error', 'multi-line'],
'dot-notation': 'error',
eqeqeq: ['error', 'always', { null: 'ignore' }],
'no-alert': 'warn',
'no-else-return': ['error', { allowElseIf: false }],
'no-eval': 'error',
'no-loop-func': 'error',
'no-multi-spaces': 'error',
'no-new': 'error',
'no-restricted-properties': ['error', { object: 'Math', property: 'pow', message: 'Use ** instead.' }],
'no-return-assign': ['error', 'always'],
'no-self-compare': 'error',
'prefer-template': 'error',
radix: 'error',
// Overrides
'no-unused-vars': ['error', { argsIgnorePattern: 'next' }],
},
},
];