@oriflame/config-eslint 4.3.0 → 5.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +2 -81
- package/dts/index.d.ts +10 -0
- package/lib/index.js +45 -40
- package/lib/index.js.map +1 -0
- package/package.json +37 -30
- package/src/index.ts +21 -27
- package/CHANGELOG.md +0 -3617
- package/lib/index.d.ts +0 -10
- package/lib/index.d.ts.map +0 -1
- package/lib/presets/SECRET_CONFIG_DO_NOT_USE_THIS.d.ts +0 -4
- package/lib/presets/SECRET_CONFIG_DO_NOT_USE_THIS.d.ts.map +0 -1
- package/lib/presets/SECRET_CONFIG_DO_NOT_USE_THIS.js +0 -32
- package/lib/presets/base.d.ts +0 -4
- package/lib/presets/base.d.ts.map +0 -1
- package/lib/presets/base.js +0 -120
- package/lib/presets/future.d.ts +0 -4
- package/lib/presets/future.d.ts.map +0 -1
- package/lib/presets/future.js +0 -13
- package/lib/presets/nextjs.d.ts +0 -4
- package/lib/presets/nextjs.d.ts.map +0 -1
- package/lib/presets/nextjs.js +0 -13
- package/lib/presets/node.d.ts +0 -4
- package/lib/presets/node.d.ts.map +0 -1
- package/lib/presets/node.js +0 -26
- package/lib/presets/prettier.d.ts +0 -4
- package/lib/presets/prettier.d.ts.map +0 -1
- package/lib/presets/prettier.js +0 -13
- package/lib/presets/typescript.d.ts +0 -4
- package/lib/presets/typescript.d.ts.map +0 -1
- package/lib/presets/typescript.js +0 -40
- package/lib/resolvers/graphql.d.ts +0 -6
- package/lib/resolvers/graphql.d.ts.map +0 -1
- package/lib/resolvers/graphql.js +0 -12
- package/lib/rules/a11y.d.ts +0 -4
- package/lib/rules/a11y.d.ts.map +0 -1
- package/lib/rules/a11y.js +0 -45
- package/lib/rules/eslint-comments.d.ts +0 -4
- package/lib/rules/eslint-comments.d.ts.map +0 -1
- package/lib/rules/eslint-comments.js +0 -14
- package/lib/rules/eslint.d.ts +0 -4
- package/lib/rules/eslint.d.ts.map +0 -1
- package/lib/rules/eslint.js +0 -385
- package/lib/rules/import.d.ts +0 -4
- package/lib/rules/import.d.ts.map +0 -1
- package/lib/rules/import.js +0 -76
- package/lib/rules/jest.d.ts +0 -4
- package/lib/rules/jest.d.ts.map +0 -1
- package/lib/rules/jest.js +0 -59
- package/lib/rules/nextjs.d.ts +0 -4
- package/lib/rules/nextjs.d.ts.map +0 -1
- package/lib/rules/nextjs.js +0 -17
- package/lib/rules/node.d.ts +0 -4
- package/lib/rules/node.d.ts.map +0 -1
- package/lib/rules/node.js +0 -45
- package/lib/rules/prettier.d.ts +0 -4
- package/lib/rules/prettier.d.ts.map +0 -1
- package/lib/rules/prettier.js +0 -6
- package/lib/rules/promise.d.ts +0 -4
- package/lib/rules/promise.d.ts.map +0 -1
- package/lib/rules/promise.js +0 -24
- package/lib/rules/react-hooks.d.ts +0 -4
- package/lib/rules/react-hooks.d.ts.map +0 -1
- package/lib/rules/react-hooks.js +0 -7
- package/lib/rules/react.d.ts +0 -4
- package/lib/rules/react.d.ts.map +0 -1
- package/lib/rules/react.js +0 -143
- package/lib/rules/testing-library.d.ts +0 -4
- package/lib/rules/testing-library.d.ts.map +0 -1
- package/lib/rules/testing-library.js +0 -31
- package/lib/rules/typescript.d.ts +0 -4
- package/lib/rules/typescript.d.ts.map +0 -1
- package/lib/rules/typescript.js +0 -369
- package/lib/rules/unicorn.d.ts +0 -4
- package/lib/rules/unicorn.d.ts.map +0 -1
- package/lib/rules/unicorn.js +0 -105
- package/src/presets/SECRET_CONFIG_DO_NOT_USE_THIS.ts +0 -34
- package/src/presets/base.ts +0 -143
- package/src/presets/future.ts +0 -13
- package/src/presets/nextjs.ts +0 -13
- package/src/presets/node.ts +0 -27
- package/src/presets/prettier.ts +0 -13
- package/src/presets/typescript.ts +0 -45
- package/src/resolvers/graphql.ts +0 -11
- package/src/rules/a11y.ts +0 -47
- package/src/rules/eslint-comments.ts +0 -16
- package/src/rules/eslint.ts +0 -384
- package/src/rules/import.ts +0 -79
- package/src/rules/jest.ts +0 -64
- package/src/rules/nextjs.ts +0 -19
- package/src/rules/node.ts +0 -47
- package/src/rules/prettier.ts +0 -8
- package/src/rules/promise.ts +0 -26
- package/src/rules/react-hooks.ts +0 -9
- package/src/rules/react.ts +0 -145
- package/src/rules/testing-library.ts +0 -33
- package/src/rules/typescript.ts +0 -377
- package/src/rules/unicorn.ts +0 -108
- package/test/index.test.ts +0 -81
- package/test/lint-files/combo.ts +0 -10
- package/test/lint-files/errors/combo.ts +0 -3
- package/test/lint-files/errors/javascript.js +0 -2
- package/test/lint-files/errors/next.js +0 -11
- package/test/lint-files/errors/node.js +0 -3
- package/test/lint-files/errors/prettier.js +0 -5
- package/test/lint-files/errors/test.js +0 -3
- package/test/lint-files/errors/typescript.ts +0 -3
- package/test/lint-files/javascript.js +0 -1
- package/test/lint-files/next.js +0 -5
- package/test/lint-files/node.js +0 -2
- package/test/lint-files/prettier.js +0 -1
- package/test/lint-files/test.js +0 -5
- package/test/lint-files/typescript.ts +0 -20
- package/test/tsconfig.json +0 -19
- package/test/utils/getErrors.ts +0 -16
- package/tools/check-rules/allRules.ts +0 -99
- package/tools/check-rules/index.ts +0 -90
- package/tools/check-rules/tsconfig.json +0 -17
- package/tsconfig.json +0 -22
- package/tsconfig.tsbuildinfo +0 -1
package/src/rules/eslint.ts
DELETED
|
@@ -1,384 +0,0 @@
|
|
|
1
|
-
import { ESLintConfig } from '@beemo/driver-eslint';
|
|
2
|
-
import confusingBrowserGlobals from 'confusing-browser-globals';
|
|
3
|
-
|
|
4
|
-
const config: ESLintConfig['rules'] = {
|
|
5
|
-
// ESLint rules
|
|
6
|
-
'accessor-pairs': 'off', // enforce getter and setter pairs in objects and classes
|
|
7
|
-
'array-bracket-newline': 'off', // enforce linebreaks after opening and before closing array brackets
|
|
8
|
-
'array-bracket-spacing': 'off', // enforce consistent spacing inside array brackets
|
|
9
|
-
'array-callback-return': ['error', { allowImplicit: true }], // enforce return statements in callbacks of array methods
|
|
10
|
-
'array-element-newline': 'off', // enforce line breaks after each array element
|
|
11
|
-
'arrow-body-style': ['warn', 'as-needed'], // require braces around arrow function bodies
|
|
12
|
-
'arrow-parens': 'off', // require parentheses around arrow function arguments
|
|
13
|
-
'arrow-spacing': 'off', // enforce consistent spacing before and after the arrow in arrow functions
|
|
14
|
-
'block-scoped-var': 'error', // enforce the use of variables within the scope they are defined
|
|
15
|
-
'block-spacing': 'off', // disallow or enforce spaces inside of blocks after opening block and before closing block
|
|
16
|
-
'brace-style': 'off', // enforce consistent brace style for blocks
|
|
17
|
-
camelcase: ['warn', { properties: 'always' }], // enforce camelcase naming convention
|
|
18
|
-
'capitalized-comments': 'off', // enforce or disallow capitalization of the first letter of a comment
|
|
19
|
-
'class-methods-use-this': 'warn', // enforce that class methods utilize this
|
|
20
|
-
'comma-dangle': 'off', // require or disallow trailing commas
|
|
21
|
-
'comma-spacing': 'off', // enforce consistent spacing before and after commas
|
|
22
|
-
'comma-style': 'off', // enforce consistent comma style
|
|
23
|
-
complexity: ['warn', 20], // enforce a maximum cyclomatic complexity allowed in a program
|
|
24
|
-
'computed-property-spacing': 'off', // enforce consistent spacing inside computed property brackets
|
|
25
|
-
'consistent-return': 'error', // require return statements to either always or never specify values
|
|
26
|
-
'consistent-this': 'off', // enforce consistent naming when capturing the current execution context
|
|
27
|
-
'constructor-super': 'error', // require super() calls in constructors
|
|
28
|
-
curly: ['error', 'all'], // enforce consistent brace style for all control statements
|
|
29
|
-
'default-case': 'warn', // require default cases in switch statements
|
|
30
|
-
'default-case-last': 'warn', // enforce default clauses in switch statements to be last
|
|
31
|
-
'default-param-last': 'warn', // enforce default parameters to be last
|
|
32
|
-
'dot-location': 'off', // enforce consistent newlines before and after dots
|
|
33
|
-
'dot-notation': ['error', { allowKeywords: true }], // enforce dot notation whenever possible
|
|
34
|
-
'eol-last': 'off', // require or disallow newline at the end of files
|
|
35
|
-
eqeqeq: ['error', 'smart'], // require the use of === and !==
|
|
36
|
-
'for-direction': 'error', // enforce `for` loop update clause moving the counter in the right direction
|
|
37
|
-
'func-call-spacing': 'off', // require or disallow spacing between function identifiers and their invocations
|
|
38
|
-
'func-name-matching': ['error', 'always', { considerPropertyDescriptor: true }], // require function names to match the name of the variable or property to which they are assigned
|
|
39
|
-
'func-names': 'warn', // require or disallow named function expressions
|
|
40
|
-
'func-style': ['warn', 'declaration', { allowArrowFunctions: true }], // enforce the consistent use of either function declarations or expressions
|
|
41
|
-
'function-call-argument-newline': 'off', // enforce line breaks between arguments of a function call
|
|
42
|
-
'function-paren-newline': 'off', // enforce consistent line breaks inside function parentheses
|
|
43
|
-
'generator-star-spacing': 'off', // enforce consistent spacing around `*` operators in generator functions
|
|
44
|
-
'getter-return': ['error', { allowImplicit: true }], // enforce return statements in getters
|
|
45
|
-
'grouped-accessor-pairs': 'warn', // require grouped accessor pairs in object literals and classes
|
|
46
|
-
'guard-for-in': 'error', // require `for-in` loops to include an `if` statement
|
|
47
|
-
'id-denylist': [
|
|
48
|
-
'error',
|
|
49
|
-
'any',
|
|
50
|
-
'Number',
|
|
51
|
-
'number',
|
|
52
|
-
'String',
|
|
53
|
-
'string',
|
|
54
|
-
'Boolean',
|
|
55
|
-
'boolean',
|
|
56
|
-
'Undefined',
|
|
57
|
-
'undefined',
|
|
58
|
-
], // disallow specified identifiers
|
|
59
|
-
'id-length': 'off', // enforce minimum and maximum identifier lengths
|
|
60
|
-
'id-match': 'off', // require identifiers to match a specified regular expression
|
|
61
|
-
'implicit-arrow-linebreak': 'off', // enforce the location of arrow function bodies
|
|
62
|
-
indent: 'off', // enforce consistent indentation
|
|
63
|
-
'init-declarations': 'off', // require or disallow initialization in variable declarations
|
|
64
|
-
'jsx-quotes': 'off', // enforce the consistent use of either double or single quotes in JSX attributes
|
|
65
|
-
'key-spacing': 'off', // enforce consistent spacing between keys and values in object literal properties
|
|
66
|
-
'keyword-spacing': 'off', // enforce consistent spacing before and after keywords
|
|
67
|
-
'line-comment-position': 'off', // enforce position of line comments
|
|
68
|
-
'linebreak-style': 'off', // enforce consistent linebreak style
|
|
69
|
-
'lines-around-comment': 'off', // require empty lines around comments
|
|
70
|
-
'lines-between-class-members': ['warn', 'always', { exceptAfterSingleLine: true }], // require or disallow an empty line between class members
|
|
71
|
-
'max-classes-per-file': ['warn', 1], // enforce a maximum number of classes per file
|
|
72
|
-
'max-depth': 'off', // enforce a maximum depth that blocks can be nested
|
|
73
|
-
'max-len': 'off', // enforce a maximum line length
|
|
74
|
-
'max-lines': 'off', // enforce a maximum number of lines per file
|
|
75
|
-
'max-lines-per-function': 'off', // enforce a maximum number of line of code in a function
|
|
76
|
-
'max-nested-callbacks': 'off', // enforce a maximum depth that callbacks can be nested
|
|
77
|
-
'max-params': ['warn', 3], // enforce a maximum number of parameters in function definitions
|
|
78
|
-
'max-statements': 'off', // enforce a maximum number of statements allowed in function blocks
|
|
79
|
-
'max-statements-per-line': 'off', // enforce a maximum number of statements allowed per line
|
|
80
|
-
'multiline-comment-style': 'off', // enforce a particular style for multiline comments
|
|
81
|
-
'multiline-ternary': 'off', // enforce newlines between operands of ternary expressions
|
|
82
|
-
'new-cap': 'warn', // require constructor names to begin with a capital letter
|
|
83
|
-
'new-parens': 'off', // enforce or disallow parentheses when invoking a constructor with no arguments
|
|
84
|
-
'newline-per-chained-call': 'off', // require a newline after each call in a method chain
|
|
85
|
-
'no-alert': 'error', // disallow the use of alert, confirm, and prompt
|
|
86
|
-
'no-array-constructor': 'warn', // disallow Array constructors
|
|
87
|
-
'no-async-promise-executor': 'error', // disallow using an async function as a Promise executor
|
|
88
|
-
'no-await-in-loop': 'warn', // disallow await inside of loops
|
|
89
|
-
'no-bitwise': 'error', // disallow bitwise operators
|
|
90
|
-
'no-caller': 'error', // disallow the use of arguments.caller or arguments.callee
|
|
91
|
-
'no-case-declarations': 'error', // disallow lexical declarations in case clauses
|
|
92
|
-
'no-class-assign': 'error', // disallow reassigning class members
|
|
93
|
-
'no-compare-neg-zero': 'error', // disallow comparing against -0
|
|
94
|
-
'no-cond-assign': ['error', 'always'], // disallow assignment operators in conditional expressions
|
|
95
|
-
'no-confusing-arrow': 'off', // disallow arrow functions where they could be confused with comparisons
|
|
96
|
-
'no-console': 'warn', // disallow the use of console
|
|
97
|
-
'no-const-assign': 'error', // disallow reassigning const variables
|
|
98
|
-
'no-constant-condition': 'warn', // disallow constant expressions in conditions
|
|
99
|
-
'no-constructor-return': 'warn', // disallow returning value from constructor
|
|
100
|
-
'no-continue': 'off', // disallow continue statements
|
|
101
|
-
'no-control-regex': 'error', // disallow control characters in regular expressions
|
|
102
|
-
'no-debugger': 'error', // disallow the use of debugger
|
|
103
|
-
'no-delete-var': 'error', // disallow deleting variables
|
|
104
|
-
'no-div-regex': 'warn', // disallow division operators explicitly at the beginning of regular expressions
|
|
105
|
-
'no-dupe-args': 'error', // disallow duplicate arguments in function definitions
|
|
106
|
-
'no-dupe-class-members': 'error', // disallow duplicate class members
|
|
107
|
-
'no-dupe-else-if': 'error', // disallow duplicate conditions in if-else-if chains
|
|
108
|
-
'no-dupe-keys': 'error', // disallow duplicate keys in object literals
|
|
109
|
-
'no-duplicate-case': 'error', // disallow duplicate case labels
|
|
110
|
-
'no-duplicate-imports': 'error', // disallow duplicate module imports
|
|
111
|
-
'no-else-return': 'error', // disallow `else` blocks after `return` statements in `if` statements
|
|
112
|
-
'no-empty': 'error', // disallow empty block statements
|
|
113
|
-
'no-empty-character-class': 'error', // disallow empty character classes in regular expressions
|
|
114
|
-
'no-empty-function': 'error', // disallow empty functions
|
|
115
|
-
'no-empty-pattern': 'error', // disallow empty destructuring patterns
|
|
116
|
-
'no-eq-null': 'off', // disallow null comparisons without type-checking operators
|
|
117
|
-
'no-eval': 'error', // disallow the use of eval()
|
|
118
|
-
'no-ex-assign': 'error', // disallow reassigning exceptions in catch clauses
|
|
119
|
-
'no-extend-native': 'error', // disallow extending native types
|
|
120
|
-
'no-extra-bind': 'error', // disallow unnecessary calls to .bind()
|
|
121
|
-
'no-extra-boolean-cast': 'error', // disallow unnecessary boolean casts
|
|
122
|
-
'no-extra-label': 'error', // disallow unnecessary labels
|
|
123
|
-
'no-extra-parens': 'off', // disallow unnecessary parentheses
|
|
124
|
-
'no-extra-semi': 'off', // disallow unnecessary semicolons
|
|
125
|
-
'no-fallthrough': 'error', // disallow fallthrough of case statements
|
|
126
|
-
'no-floating-decimal': 'off', // disallow leading or trailing decimal points in numeric literals
|
|
127
|
-
'no-func-assign': 'error', // disallow reassigning function declarations
|
|
128
|
-
'no-global-assign': 'error', // disallow assignments to native objects or read-only global variables
|
|
129
|
-
'no-implicit-coercion': 'off', // disallow shorthand type conversions
|
|
130
|
-
'no-implicit-globals': 'error', // disallow declarations in the global scope
|
|
131
|
-
'no-implied-eval': 'error', // disallow the use of eval()-like methods
|
|
132
|
-
'no-import-assign': 'error', // disallow assigning to imported bindings
|
|
133
|
-
'no-inline-comments': 'off', // disallow inline comments after code
|
|
134
|
-
'no-inner-declarations': 'error', // disallow variable or function declarations in nested blocks
|
|
135
|
-
'no-invalid-regexp': 'error', // disallow invalid regular expression strings in RegExp constructors
|
|
136
|
-
'no-invalid-this': 'error', // disallow this keywords outside of classes or class-like objects
|
|
137
|
-
'no-irregular-whitespace': 'error', // disallow irregular whitespace
|
|
138
|
-
'no-iterator': 'error', // disallow the use of the __iterator__ property
|
|
139
|
-
'no-label-var': 'error', // disallow labels that share a name with a variable
|
|
140
|
-
'no-labels': 'error', // disallow labeled statements
|
|
141
|
-
'no-lone-blocks': 'error', // disallow unnecessary nested blocks
|
|
142
|
-
'no-lonely-if': 'error', // disallow if statements as the only statement in else blocks
|
|
143
|
-
'no-loop-func': 'error', // disallow function declarations that contain unsafe references inside loop statements
|
|
144
|
-
'no-loss-of-precision': 'error', // disallow literal numbers that lose precision
|
|
145
|
-
'no-magic-numbers': 'off', // disallow magic numbers
|
|
146
|
-
'no-misleading-character-class': 'error', // disallow characters which are made with multiple code points in character class syntax
|
|
147
|
-
'no-mixed-operators': 'off', // disallow mixed binary operators
|
|
148
|
-
'no-mixed-spaces-and-tabs': 'off', // disallow mixed spaces and tabs for indentation
|
|
149
|
-
'no-multi-assign': 'error', // disallow use of chained assignment expressions
|
|
150
|
-
'no-multi-spaces': 'off', // disallow multiple spaces
|
|
151
|
-
'no-multi-str': 'error', // disallow multiline strings
|
|
152
|
-
'no-multiple-empty-lines': 'off', // disallow multiple empty lines
|
|
153
|
-
'no-negated-condition': 'error', // disallow negated conditions
|
|
154
|
-
'no-nested-ternary': 'error', // disallow nested ternary expressions
|
|
155
|
-
'no-new': 'error', // disallow new operators outside of assignments or comparisons
|
|
156
|
-
'no-new-func': 'error', // disallow new operators with the Function object
|
|
157
|
-
'no-new-object': 'error', // disallow Object constructors
|
|
158
|
-
'no-new-symbol': 'error', // disallow new operators with the Symbol object
|
|
159
|
-
'no-new-wrappers': 'error', // disallow new operators with the String, Number, and Boolean objects
|
|
160
|
-
'no-nonoctal-decimal-escape': 'error', // disallow `\8` and `\9` escape sequences in string literals
|
|
161
|
-
'no-obj-calls': 'error', // disallow calling global object properties as functions
|
|
162
|
-
'no-octal': 'error', // disallow octal literals
|
|
163
|
-
'no-octal-escape': 'error', // disallow octal escape sequences in string literals
|
|
164
|
-
'no-param-reassign': [
|
|
165
|
-
'error',
|
|
166
|
-
{
|
|
167
|
-
props: true,
|
|
168
|
-
ignorePropertyModificationsFor: [
|
|
169
|
-
'accumulator',
|
|
170
|
-
'error',
|
|
171
|
-
'context',
|
|
172
|
-
'request',
|
|
173
|
-
'response',
|
|
174
|
-
'$scope',
|
|
175
|
-
'staticContext',
|
|
176
|
-
],
|
|
177
|
-
},
|
|
178
|
-
], // disallow reassigning function parameters
|
|
179
|
-
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }], // disallow the unary operators `++` and `--`
|
|
180
|
-
'no-promise-executor-return': 'error', // disallow returning values from Promise executor functions
|
|
181
|
-
'no-proto': 'error', // disallow the use of the __proto__ property
|
|
182
|
-
'no-prototype-builtins': 'warn', // disallow calling some Object.prototype methods directly on objects
|
|
183
|
-
'no-redeclare': 'error', // disallow variable redeclaration
|
|
184
|
-
'no-regex-spaces': 'error', // disallow multiple spaces in regular expressions
|
|
185
|
-
'no-restricted-exports': [
|
|
186
|
-
'error',
|
|
187
|
-
{
|
|
188
|
-
restrictedNamedExports: [
|
|
189
|
-
'then', // this will cause tons of confusion when your module is dynamically `import()`ed
|
|
190
|
-
],
|
|
191
|
-
},
|
|
192
|
-
], // disallow specified names in exports
|
|
193
|
-
'no-restricted-globals': [
|
|
194
|
-
'error',
|
|
195
|
-
{
|
|
196
|
-
name: 'isFinite',
|
|
197
|
-
message: 'Use Number.isFinite instead',
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
name: 'isNaN',
|
|
201
|
-
message: 'Use Number.isNaN instead',
|
|
202
|
-
},
|
|
203
|
-
...confusingBrowserGlobals,
|
|
204
|
-
], // disallow specified global variables
|
|
205
|
-
'no-restricted-imports': 'off', // disallow specified modules when loaded by import
|
|
206
|
-
'no-restricted-properties': [
|
|
207
|
-
'error',
|
|
208
|
-
{
|
|
209
|
-
object: 'arguments',
|
|
210
|
-
property: 'callee',
|
|
211
|
-
message: 'arguments.callee is deprecated',
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
object: 'global',
|
|
215
|
-
property: 'isFinite',
|
|
216
|
-
message: 'Please use Number.isFinite instead',
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
object: 'self',
|
|
220
|
-
property: 'isFinite',
|
|
221
|
-
message: 'Please use Number.isFinite instead',
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
object: 'window',
|
|
225
|
-
property: 'isFinite',
|
|
226
|
-
message: 'Please use Number.isFinite instead',
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
object: 'global',
|
|
230
|
-
property: 'isNaN',
|
|
231
|
-
message: 'Please use Number.isNaN instead',
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
object: 'self',
|
|
235
|
-
property: 'isNaN',
|
|
236
|
-
message: 'Please use Number.isNaN instead',
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
object: 'window',
|
|
240
|
-
property: 'isNaN',
|
|
241
|
-
message: 'Please use Number.isNaN instead',
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
property: '__defineGetter__',
|
|
245
|
-
message: 'Please use Object.defineProperty instead.',
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
property: '__defineSetter__',
|
|
249
|
-
message: 'Please use Object.defineProperty instead.',
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
object: 'Math',
|
|
253
|
-
property: 'pow',
|
|
254
|
-
message: 'Use the exponentiation operator (**) instead.',
|
|
255
|
-
},
|
|
256
|
-
], // disallow certain properties on certain objects
|
|
257
|
-
'no-restricted-syntax': 'off', // disallow specified syntax
|
|
258
|
-
'no-return-assign': 'error', // disallow assignment operators in return statements
|
|
259
|
-
'no-return-await': 'error', // disallow unnecessary return await
|
|
260
|
-
'no-script-url': 'error', // disallow javascript: urls
|
|
261
|
-
'no-self-assign': 'error', // disallow assignments where both sides are exactly the same
|
|
262
|
-
'no-self-compare': 'error', // disallow comparisons where both sides are exactly the same
|
|
263
|
-
'no-sequences': ['error', { allowInParentheses: false }], // disallow comma operators
|
|
264
|
-
'no-setter-return': 'error', // disallow returning values from setters
|
|
265
|
-
'no-shadow': ['warn', { allow: ['resolve, reject'] }], // disallow variable declarations from shadowing variables declared in the outer scope
|
|
266
|
-
'no-shadow-restricted-names': 'error', // disallow identifiers from shadowing restricted names
|
|
267
|
-
'no-sparse-arrays': 'error', // disallow sparse arrays
|
|
268
|
-
'no-tabs': 'off', // disallow all tabs
|
|
269
|
-
'no-template-curly-in-string': 'error', // disallow template literal placeholder syntax in regular strings
|
|
270
|
-
'no-ternary': 'off', // disallow ternary operators
|
|
271
|
-
'no-this-before-super': 'error', // disallow this/super before calling super() in constructors
|
|
272
|
-
'no-throw-literal': 'error', // disallow throwing literals as exceptions
|
|
273
|
-
'no-trailing-spaces': 'off', // disallow trailing whitespace at the end of lines
|
|
274
|
-
'no-undef': 'error', // disallow the use of undeclared variables unless mentioned in /* global */ comments
|
|
275
|
-
'no-undef-init': 'error', // disallow initializing variables to undefined
|
|
276
|
-
'no-undefined': 'off', // disallow the use of undefined as an identifier
|
|
277
|
-
'no-underscore-dangle': 'error', // disallow dangling underscores in identifiers
|
|
278
|
-
'no-unexpected-multiline': 'warn', // disallow confusing multiline expressions
|
|
279
|
-
'no-unmodified-loop-condition': 'warn', // disallow unmodified loop conditions
|
|
280
|
-
'no-unneeded-ternary': ['error', { defaultAssignment: false }], // disallow ternary operators when simpler alternatives exist
|
|
281
|
-
'no-unreachable': 'error', // disallow unreachable code after return, throw, continue, and break statements
|
|
282
|
-
'no-unreachable-loop': 'warn', // disallow loops with a body that allows only one iteration
|
|
283
|
-
'no-unsafe-finally': 'error', // disallow control flow statements in finally blocks
|
|
284
|
-
'no-unsafe-negation': 'error', // disallow negating the left operand of relational operators
|
|
285
|
-
'no-unsafe-optional-chaining': 'error', // disallow use of optional chaining in contexts where the `undefined` value is not allowed
|
|
286
|
-
'no-unused-expressions': [
|
|
287
|
-
'error',
|
|
288
|
-
{ allowShortCircuit: true, allowTernary: true, enforceForJSX: true },
|
|
289
|
-
], // disallow unused expressions
|
|
290
|
-
'no-unused-labels': 'error', // disallow unused labels
|
|
291
|
-
'no-unused-vars': ['error', { vars: 'local', args: 'after-used' }], // disallow unused variables
|
|
292
|
-
'no-use-before-define': 'error', // disallow the use of variables before they are defined
|
|
293
|
-
'no-useless-backreference': 'warn', // disallow useless backreferences in regular expressions
|
|
294
|
-
'no-useless-call': 'error', // disallow unnecessary calls to .call() and .apply()
|
|
295
|
-
'no-useless-catch': 'error', // disallow unnecessary catch clauses
|
|
296
|
-
'no-useless-computed-key': 'error', // disallow unnecessary computed property keys in objects and classes
|
|
297
|
-
'no-useless-concat': 'error', // disallow unnecessary concatenation of literals or template literals
|
|
298
|
-
'no-useless-constructor': 'error', // disallow unnecessary constructors
|
|
299
|
-
'no-useless-escape': 'error', // disallow unnecessary escape characters
|
|
300
|
-
'no-useless-rename': 'error', // disallow renaming import, export, and destructured assignments to the same name
|
|
301
|
-
'no-useless-return': 'error', // disallow redundant return statements
|
|
302
|
-
'no-var': 'error', // require let or const instead of var
|
|
303
|
-
'no-void': 'off', // disallow void operators
|
|
304
|
-
'no-warning-comments': ['warn', { terms: ['todo:', 'fixme:', 'debug:'], location: 'start' }], // disallow specified warning terms in comments
|
|
305
|
-
'no-whitespace-before-property': 'off', // disallow whitespace before properties
|
|
306
|
-
'no-with': 'error', // disallow with statements
|
|
307
|
-
'nonblock-statement-body-position': 'off', // enforce the location of single-line statements
|
|
308
|
-
'object-curly-newline': 'off', // enforce consistent line breaks inside braces
|
|
309
|
-
'object-curly-spacing': 'off', // enforce consistent spacing inside braces
|
|
310
|
-
'object-property-newline': 'off', // enforce placing object properties on separate lines
|
|
311
|
-
'object-shorthand': ['error', 'always', { avoidQuotes: true }], // require or disallow method and property shorthand syntax for object literals
|
|
312
|
-
'one-var': ['error', 'never'], // enforce variables to be declared either together or separately in functions
|
|
313
|
-
'one-var-declaration-per-line': 'off', // require or disallow newlines around variable declarations
|
|
314
|
-
'operator-assignment': ['error', 'always'], // require or disallow assignment operator shorthand where possible
|
|
315
|
-
'operator-linebreak': 'off', // enforce consistent linebreak style for operators
|
|
316
|
-
'padded-blocks': 'off', // require or disallow padding within blocks
|
|
317
|
-
'padding-line-between-statements': [
|
|
318
|
-
'warn',
|
|
319
|
-
{ blankLine: 'always', prev: '*', next: 'return' },
|
|
320
|
-
{ blankLine: 'always', prev: 'import', next: '*' },
|
|
321
|
-
{ blankLine: 'any', prev: 'import', next: 'import' },
|
|
322
|
-
], // require or disallow padding lines between statements
|
|
323
|
-
'prefer-arrow-callback': 'error', // require using arrow functions for callbacks
|
|
324
|
-
'prefer-const': 'error', // require const declarations for variables that are never reassigned after declared
|
|
325
|
-
'prefer-destructuring': [
|
|
326
|
-
'error',
|
|
327
|
-
{
|
|
328
|
-
VariableDeclarator: { array: false, object: true },
|
|
329
|
-
AssignmentExpression: { array: true, object: false },
|
|
330
|
-
},
|
|
331
|
-
{ enforceForRenamedProperties: false },
|
|
332
|
-
], // require destructuring from arrays and/or objects
|
|
333
|
-
'prefer-exponentiation-operator': 'error', // disallow the use of `Math.pow` in favor of the `**` operator
|
|
334
|
-
'prefer-named-capture-group': 'off', // enforce using named capture group in regular expression
|
|
335
|
-
'prefer-numeric-literals': 'error', // disallow parseInt() and Number.parseInt() in favor of binary, octal, and hexadecimal literals
|
|
336
|
-
'prefer-object-spread': 'error', // disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead.
|
|
337
|
-
'prefer-promise-reject-errors': 'error', // require using Error objects as Promise rejection reasons
|
|
338
|
-
'prefer-regex-literals': 'error', // disallow use of the RegExp constructor in favor of regular expression literals
|
|
339
|
-
'prefer-rest-params': 'error', // require rest parameters instead of arguments
|
|
340
|
-
'prefer-spread': 'error', // require spread operators instead of .apply()
|
|
341
|
-
'prefer-template': 'error', // require template literals instead of string concatenation
|
|
342
|
-
'quote-props': 'off', // require quotes around object literal property names
|
|
343
|
-
quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: false }], // enforce the consistent use of either backticks, double, or single quotes
|
|
344
|
-
radix: 'error', // enforce the consistent use of the radix argument when using parseInt()
|
|
345
|
-
'require-atomic-updates': 'warn', // disallow assignments that can lead to race conditions due to usage of await or yield
|
|
346
|
-
'require-await': 'off', // disallow async functions which have no await expression
|
|
347
|
-
'require-unicode-regexp': 'off', // enforce the use of `u` flag on RegExp
|
|
348
|
-
'require-yield': 'error', // require generator functions to contain yield
|
|
349
|
-
'rest-spread-spacing': 'off', // enforce spacing between rest and spread operators and their expressions
|
|
350
|
-
semi: 'off', // require or disallow semicolons instead of ASI
|
|
351
|
-
'semi-spacing': 'off', // enforce consistent spacing before and after semicolons
|
|
352
|
-
'semi-style': 'off', // enforce location of semicolons
|
|
353
|
-
'sort-imports': [
|
|
354
|
-
'warn',
|
|
355
|
-
{
|
|
356
|
-
ignoreCase: true,
|
|
357
|
-
memberSyntaxSortOrder: ['none', 'single', 'all', 'multiple'],
|
|
358
|
-
allowSeparatedGroups: true,
|
|
359
|
-
},
|
|
360
|
-
], // enforce sorted import declarations within modules
|
|
361
|
-
'sort-keys': 'off', // require object keys to be sorted
|
|
362
|
-
'sort-vars': 'off', // require variables within the same declaration block to be sorted
|
|
363
|
-
'space-before-blocks': 'off', // enforce consistent spacing before blocks
|
|
364
|
-
'space-before-function-paren': 'off', // enforce consistent spacing before function definition opening parenthesis
|
|
365
|
-
'space-in-parens': 'off', // enforce consistent spacing inside parentheses
|
|
366
|
-
'space-infix-ops': 'off', // require spacing around infix operators
|
|
367
|
-
'space-unary-ops': 'off', // enforce consistent spacing before or after unary operators
|
|
368
|
-
'spaced-comment': ['warn', 'always'], // enforce consistent spacing after the `//` or `/*` in a comment
|
|
369
|
-
strict: ['error', 'never'], // require or disallow strict mode directives
|
|
370
|
-
'switch-colon-spacing': 'off', // enforce spacing around colons of switch statements
|
|
371
|
-
'symbol-description': 'error', // require symbol descriptions
|
|
372
|
-
'template-curly-spacing': 'off', // require or disallow spacing around embedded expressions of template strings
|
|
373
|
-
'template-tag-spacing': 'off', // require or disallow spacing between template tags and their literals
|
|
374
|
-
'unicode-bom': 'off', // require or disallow Unicode byte order mark (BOM)
|
|
375
|
-
'use-isnan': 'error', // require calls to isNaN() when checking for NaN
|
|
376
|
-
'valid-typeof': ['error', { requireStringLiterals: true }], // enforce comparing typeof expressions against valid strings
|
|
377
|
-
'vars-on-top': 'error', // require var declarations be placed at the top of their containing scope
|
|
378
|
-
'wrap-iife': 'off', // require parentheses around immediate function invocations
|
|
379
|
-
'wrap-regex': 'off', // require parenthesis around regex literals
|
|
380
|
-
'yield-star-spacing': 'off', // require or disallow spacing around the `*` in `yield*` expressions
|
|
381
|
-
yoda: 'error', // require or disallow “Yoda” conditions
|
|
382
|
-
};
|
|
383
|
-
|
|
384
|
-
export = config;
|
package/src/rules/import.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { ESLintConfig } from '@beemo/driver-eslint';
|
|
2
|
-
import { JSX_EXTS_GROUP } from '@oriflame/lumos-common';
|
|
3
|
-
|
|
4
|
-
const config: ESLintConfig['rules'] = {
|
|
5
|
-
// override ESLint rules
|
|
6
|
-
'no-duplicate-imports': 'off', // disallow duplicate module imports
|
|
7
|
-
'sort-imports': 'off', // enforce sorted import declarations within modules
|
|
8
|
-
|
|
9
|
-
// eslint-plugin-import rules
|
|
10
|
-
'import/default': 'off', // ensure a default export is present, given a default import
|
|
11
|
-
'import/dynamic-import-chunkname': 'off', // enforce a leading comment with the webpackChunkName for dynamic imports
|
|
12
|
-
'import/export': 'error', // report any invalid exports, i.e. re-export of the same name
|
|
13
|
-
'import/exports-last': 'off', // ensure all exports appear after other statements
|
|
14
|
-
'import/extensions': ['error', 'always', { js: 'never', jsx: 'never', mjs: 'never' }], // ensure consistent use of file extension within the import path
|
|
15
|
-
'import/first': 'error', // ensure all imports appear before other statements
|
|
16
|
-
'import/group-exports': 'off', // prefer named exports to be grouped together in a single export declaration
|
|
17
|
-
'import/max-dependencies': 'off', // limit the maximum number of dependencies a module can have
|
|
18
|
-
'import/no-internal-modules': 'off', // prevent importing the submodules of other modules
|
|
19
|
-
/* TODO [enable this when https://github.com/benmosher/eslint-plugin-import/issues/1998 is fixed]: 'import/named': 'error', // ensure named imports correspond to a named export in the remote file */
|
|
20
|
-
'import/named': 'off', // ensure named imports correspond to a named export in the remote file
|
|
21
|
-
'import/namespace': 'off', // ensure imported namespaces contain dereferenced properties as they are dereferenced
|
|
22
|
-
'import/newline-after-import': 'warn', // enforce a newline after import statements
|
|
23
|
-
'import/no-absolute-path': 'error', // forbid import of modules using absolute paths
|
|
24
|
-
'import/no-amd': 'error', // report AMD require and define calls
|
|
25
|
-
'import/no-anonymous-default-export': 'off', // forbid anonymous values as default exports
|
|
26
|
-
'import/no-commonjs': 'off', // report CommonJS require calls and module.exports or exports.*
|
|
27
|
-
'import/no-cycle': 'error', // forbid a module from importing a module with a dependency path back to itself
|
|
28
|
-
'import/no-default-export': 'off', // forbid default exports
|
|
29
|
-
'import/no-deprecated': 'warn', // report imported names marked with @deprecated documentation tag
|
|
30
|
-
'import/no-duplicates': 'error', // report repeated import of the same module in multiple places
|
|
31
|
-
'import/no-dynamic-require': 'error', // forbid require() calls with expressions
|
|
32
|
-
'import/no-extraneous-dependencies': [
|
|
33
|
-
'error',
|
|
34
|
-
{
|
|
35
|
-
devDependencies: [
|
|
36
|
-
`test/**/*.${JSX_EXTS_GROUP}`,
|
|
37
|
-
`tests/**/*.${JSX_EXTS_GROUP}`,
|
|
38
|
-
`**/*.test.${JSX_EXTS_GROUP}`,
|
|
39
|
-
`__tests__/**/*.${JSX_EXTS_GROUP}`,
|
|
40
|
-
`**/__tests__/**/*.${JSX_EXTS_GROUP}`,
|
|
41
|
-
`**/jest.config.${JSX_EXTS_GROUP}`,
|
|
42
|
-
`**/webpack.config.${JSX_EXTS_GROUP}`,
|
|
43
|
-
`**/webpack.config.*.${JSX_EXTS_GROUP}`,
|
|
44
|
-
`tools/**/*.${JSX_EXTS_GROUP}`,
|
|
45
|
-
],
|
|
46
|
-
optionalDependencies: false,
|
|
47
|
-
},
|
|
48
|
-
], // forbid the use of extraneous packages
|
|
49
|
-
'import/no-import-module-exports': 'off', // forbid imports with CommonJS exports
|
|
50
|
-
'import/no-mutable-exports': 'error', // forbid the use of mutable exports with var or let
|
|
51
|
-
'import/no-named-as-default': 'off', // report use of exported name as identifier of default export
|
|
52
|
-
'import/no-named-as-default-member': 'error', // report use of exported name as property of default export
|
|
53
|
-
'import/no-named-default': 'error', // forbid named default exports
|
|
54
|
-
'import/no-named-export': 'off', // forbid named exports
|
|
55
|
-
'import/no-namespace': 'off', // forbid namespace (a.k.a. "wildcard" *) imports
|
|
56
|
-
'import/no-nodejs-modules': 'off', // no Node.js builtin modules
|
|
57
|
-
/* TODO [enable this when https://github.com/benmosher/eslint-plugin-import/issues/2081 is fixed]: 'import/no-relative-packages': 'error', // prevent importing packages through relative paths */
|
|
58
|
-
'import/no-relative-packages': 'off', // prevent importing packages through relative paths
|
|
59
|
-
'import/no-relative-parent-imports': 'off', // forbid importing modules from parent directories
|
|
60
|
-
'import/no-restricted-paths': 'off', // restrict which files can be imported in a given folder
|
|
61
|
-
'import/no-self-import': 'error', // forbid a module from importing itself
|
|
62
|
-
'import/no-unassigned-import': 'off', // forbid unassigned imports
|
|
63
|
-
'import/no-unresolved': ['error', { commonjs: true, caseSensitive: true }], // ensure imports point to a file/module that can be resolved
|
|
64
|
-
'import/no-unused-modules': 'off', // report modules without exports, or exports without matching import in another module
|
|
65
|
-
'import/no-useless-path-segments': ['error', { noUselessIndex: true }], // prevent unnecessary path segments in import and require statements
|
|
66
|
-
'import/no-webpack-loader-syntax': 'error', // forbid webpack loader syntax in imports
|
|
67
|
-
'import/unambiguous': 'off', // report potentially ambiguous parse goal (script vs. module)
|
|
68
|
-
'import/order': [
|
|
69
|
-
'warn',
|
|
70
|
-
{
|
|
71
|
-
groups: [['builtin', 'external']],
|
|
72
|
-
'newlines-between': 'always',
|
|
73
|
-
alphabetize: { order: 'asc', caseInsensitive: true },
|
|
74
|
-
},
|
|
75
|
-
], // enforce a convention in module import order
|
|
76
|
-
'import/prefer-default-export': 'off', // prefer a default export if module exports a single name
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export = config;
|
package/src/rules/jest.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { ESLintConfig } from '@beemo/driver-eslint';
|
|
2
|
-
|
|
3
|
-
const config: ESLintConfig['rules'] = {
|
|
4
|
-
// override ESLint rules
|
|
5
|
-
'max-classes-per-file': 'off',
|
|
6
|
-
|
|
7
|
-
// override eslint-plugin-node rules
|
|
8
|
-
'node/no-sync': 'off', // disallow synchronous methods
|
|
9
|
-
|
|
10
|
-
// override @typescript-eslint/eslint-plugin rules
|
|
11
|
-
'@typescript-eslint/ban-ts-comment': 'off', // bans // @ts-<directive> comments from being used
|
|
12
|
-
'@typescript-eslint/no-floating-promises': 'off', // requires Promise-like values to be handled appropriately
|
|
13
|
-
'@typescript-eslint/unbound-method': 'off', // enforces unbound methods are called with their expected scope
|
|
14
|
-
|
|
15
|
-
// eslint-plugin-jest
|
|
16
|
-
'jest/consistent-test-it': 'off', // have control over test and it usages
|
|
17
|
-
'jest/expect-expect': 'warn', // enforce assertion to be made in a test body
|
|
18
|
-
'jest/lowercase-name': 'off', // enforce lowercase test names
|
|
19
|
-
'jest/max-nested-describe': [
|
|
20
|
-
'error',
|
|
21
|
-
{
|
|
22
|
-
max: 3,
|
|
23
|
-
},
|
|
24
|
-
], // enforces a maximum depth to nested describe calls
|
|
25
|
-
'jest/no-alias-methods': 'warn', // disallow alias methods
|
|
26
|
-
'jest/no-commented-out-tests': 'warn', // disallow commented out tests
|
|
27
|
-
'jest/no-conditional-expect': 'error', // prevent calling expect conditionally
|
|
28
|
-
'jest/no-deprecated-functions': 'error', // disallow use of deprecated functions
|
|
29
|
-
'jest/no-disabled-tests': 'warn', // disallow disabled tests
|
|
30
|
-
'jest/no-done-callback': 'warn', // avoid using a callback in asynchronous tests and hooks
|
|
31
|
-
'jest/no-duplicate-hooks': 'error', // disallow duplicate setup and teardown hooks
|
|
32
|
-
'jest/no-export': 'error', // disallow using exports in files containing tests
|
|
33
|
-
'jest/no-focused-tests': 'error', // disallow focused tests
|
|
34
|
-
'jest/no-hooks': 'off', // disallow setup and teardown hooks
|
|
35
|
-
'jest/no-identical-title': 'error', // disallow identical titles
|
|
36
|
-
'jest/no-if': 'error', // disallow conditional logic
|
|
37
|
-
'jest/no-interpolation-in-snapshots': 'error', // disallow string interpolation inside snapshots
|
|
38
|
-
'jest/no-jasmine-globals': 'error', // disallow Jasmine globals
|
|
39
|
-
'jest/no-jest-import': 'error', // disallow importing Jest
|
|
40
|
-
'jest/no-large-snapshots': 'off', // disallow large snapshots
|
|
41
|
-
'jest/no-mocks-import': 'error', // disallow manually importing from __mocks__
|
|
42
|
-
'jest/no-restricted-matchers': 'off', // disallow specific matchers & modifiers
|
|
43
|
-
'jest/no-standalone-expect': 'error', // disallow using expect outside of it or test blocks
|
|
44
|
-
'jest/no-test-prefixes': 'error', // use .only and .skip over f and x
|
|
45
|
-
'jest/no-test-return-statement': 'error', // disallow explicitly returning from tests
|
|
46
|
-
'jest/prefer-called-with': 'warn', // suggest using toBeCalledWith() or toHaveBeenCalledWith()
|
|
47
|
-
'jest/prefer-expect-assertions': 'off', // suggest using expect.assertions() OR expect.hasAssertions()
|
|
48
|
-
'jest/prefer-hooks-on-top': 'warn', // suggest having hooks before any test cases
|
|
49
|
-
'jest/prefer-spy-on': 'error', // suggest using jest.spyOn()
|
|
50
|
-
'jest/prefer-strict-equal': 'off', // suggest using toStrictEqual()
|
|
51
|
-
'jest/prefer-to-contain': 'warn', // suggest using toContain()
|
|
52
|
-
'jest/prefer-to-have-length': 'warn', // suggest using toHaveLength()
|
|
53
|
-
'jest/prefer-todo': 'warn', // suggest using test.todo
|
|
54
|
-
'jest/require-to-throw-message': 'error', // require a message for toThrow()
|
|
55
|
-
'jest/require-top-level-describe': 'error', // require test cases and hooks to be inside a describe block
|
|
56
|
-
'jest/unbound-method': 'error', // enforces unbound methods are called with their expected scope
|
|
57
|
-
'jest/valid-describe-callback': 'error', // enforce valid describe() callback
|
|
58
|
-
'jest/prefer-lowercase-title': ['warn', { allowedPrefixes: [], ignoreTopLevelDescribe: true }], // enforce valid describe() callback
|
|
59
|
-
'jest/valid-expect': ['error', { alwaysAwait: true }], // enforce valid expect() usage
|
|
60
|
-
'jest/valid-expect-in-promise': 'error', // enforce having return statement when testing with promises
|
|
61
|
-
'jest/valid-title': 'warn', // enforce valid titles
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export = config;
|
package/src/rules/nextjs.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ESLintConfig } from '@beemo/driver-eslint';
|
|
2
|
-
|
|
3
|
-
const config: ESLintConfig['rules'] = {
|
|
4
|
-
'@next/next/google-font-display': 'off', // enforce optional or swap font-display behavior with Google Fonts
|
|
5
|
-
'@next/next/google-font-preconnect': 'off', // enforce preconnect usage with Google Fonts
|
|
6
|
-
'@next/next/link-passhref': 'warn', // enforce passHref prop usage with custom Link components
|
|
7
|
-
'@next/next/no-css-tags': 'off', // prevent manual stylesheet tags
|
|
8
|
-
'@next/next/no-document-import-in-page': 'error', // disallow importing next/document outside of pages/document.js
|
|
9
|
-
'@next/next/no-head-import-in-document': 'error', // disallow importing next/head in pages/document.js
|
|
10
|
-
'@next/next/no-html-link-for-pages': 'error', // prohibit HTML anchor links to pages without a Link component
|
|
11
|
-
'@next/next/no-img-element': 'off', // prohibit usage of HTML <img> element
|
|
12
|
-
'@next/next/no-page-custom-font': 'off', // prevent page-only custom fonts
|
|
13
|
-
'@next/next/no-sync-scripts': 'warn', // forbid synchronous scripts
|
|
14
|
-
'@next/next/no-title-in-document-head': 'error', // disallow using <title> with Head from next/document
|
|
15
|
-
'@next/next/no-unwanted-polyfillio': 'off', // prevent duplicate polyfills from Polyfill.io
|
|
16
|
-
'@next/next/no-typos': 'warn', // ensure no typos were made declaring Next.js's data fetching function
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export = config;
|
package/src/rules/node.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { ESLintConfig } from '@beemo/driver-eslint';
|
|
2
|
-
|
|
3
|
-
const config: ESLintConfig['rules'] = {
|
|
4
|
-
// eslint-plugin-node rules
|
|
5
|
-
'node/callback-return': 'warn', // require return statements after callbacks
|
|
6
|
-
'node/exports-style': 'off', // enforce either module.exports or exports
|
|
7
|
-
'node/file-extension-in-import': ['error', 'always', { '.js': 'never', '.jsx': 'never' }], // enforce the style of file extensions in import declarations
|
|
8
|
-
'node/global-require': 'warn', // require require() calls to be placed at top-level module scope
|
|
9
|
-
'node/handle-callback-err': 'warn', // require error handling in callbacks
|
|
10
|
-
'node/no-callback-literal': 'off', // ensure Node.js-style error-first callback pattern is followed
|
|
11
|
-
'node/no-deprecated-api': 'error', // disallow deprecated APIs
|
|
12
|
-
'node/no-exports-assign': 'error', // disallow the assignment to exports
|
|
13
|
-
'node/no-extraneous-import': 'off', // disallow import declarations which import extraneous modules
|
|
14
|
-
'node/no-extraneous-require': 'off', // disallow require() expressions which import extraneous modules
|
|
15
|
-
'node/no-missing-import': 'error', // disallow import declarations which import non-existence modules
|
|
16
|
-
'node/no-missing-require': 'error', // disallow require() expressions which import non-existence modules
|
|
17
|
-
'node/no-mixed-requires': 'warn', // disallow require calls to be mixed with regular variable declarations
|
|
18
|
-
'node/no-new-require': 'warn', // disallow new operators with calls to require
|
|
19
|
-
'node/no-path-concat': 'warn', // disallow string concatenation with __dirname and __filename
|
|
20
|
-
'node/no-process-env': 'off', // disallow the use of process.env
|
|
21
|
-
'node/no-process-exit': 'warn', // disallow the use of process.exit()
|
|
22
|
-
'node/no-restricted-import': 'off', // disallow specified modules when loaded by import declarations
|
|
23
|
-
'node/no-restricted-require': 'off', // disallow specified modules when loaded by require
|
|
24
|
-
'node/no-sync': 'warn', // disallow synchronous methods
|
|
25
|
-
'node/no-unpublished-bin': 'off', // disallow bin files that npm ignores
|
|
26
|
-
'node/no-unpublished-import': 'off', // disallow import declarations which import private modules
|
|
27
|
-
'node/no-unpublished-require': 'off', // disallow require() expressions which import private modules
|
|
28
|
-
'node/no-unsupported-features/es-builtins': ['error', { ignores: [], version: '>=14.0.0' }], // disallow unsupported ECMAScript built-ins on the specified version
|
|
29
|
-
'node/no-unsupported-features/es-syntax': [
|
|
30
|
-
'error',
|
|
31
|
-
{ ignores: ['modules', 'dynamicImport'], version: '>=14.0.0' },
|
|
32
|
-
], // disallow unsupported ECMAScript syntax on the specified version
|
|
33
|
-
'node/no-unsupported-features/node-builtins': ['error', { ignores: [], version: '>=14.0.0' }], // disallow unsupported Node.js built-in APIs on the specified version
|
|
34
|
-
'node/prefer-global/buffer': 'warn', // enforce either Buffer or require("buffer").Buffer
|
|
35
|
-
'node/prefer-global/console': 'warn', // enforce either console or require("console")
|
|
36
|
-
'node/prefer-global/process': 'warn', // enforce either process or require("process")
|
|
37
|
-
'node/prefer-global/text-decoder': 'warn', // enforce either TextDecoder or require("util").TextDecoder
|
|
38
|
-
'node/prefer-global/text-encoder': 'warn', // enforce either TextEncoder or require("util").TextEncoder
|
|
39
|
-
'node/prefer-global/url': 'warn', // enforce either URL or require("url").URL
|
|
40
|
-
'node/prefer-global/url-search-params': 'warn', // enforce either URLSearchParams or require("url").URLSearchParams
|
|
41
|
-
'node/prefer-promises/dns': 'error', // enforce require("dns").promises
|
|
42
|
-
'node/prefer-promises/fs': 'error', // enforce require("fs").promises
|
|
43
|
-
'node/process-exit-as-throw': 'off', // make process.exit() expressions the same code path as throw
|
|
44
|
-
'node/shebang': 'warn', // suggest correct usage of shebang
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export = config;
|