eser 2.1.9 → 3.0.0-rc.2
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/defterdar.js +13 -0
- package/deno.json +6 -0
- package/deno.lock +52 -0
- package/hizli-api.js +78 -0
- package/main.js +5 -0
- package/mod.js +3 -0
- package/mod_test.js +5 -0
- package/package.json +12 -37
- package/.editorconfig +0 -14
- package/.gitattributes +0 -11
- package/.github/FUNDING.yml +0 -5
- package/LICENSE +0 -22
- package/README.md +0 -3794
- package/css-in-javascript/README.md +0 -432
- package/linters/.eslintrc +0 -6
- package/linters/.markdownlint.json +0 -154
- package/packages/eslint-config-eser/.editorconfig +0 -14
- package/packages/eslint-config-eser/.eslintrc +0 -3
- package/packages/eslint-config-eser/README.md +0 -19
- package/packages/eslint-config-eser/index.js +0 -20
- package/packages/eslint-config-eser/package.json +0 -49
- package/packages/eslint-config-eser/rules/best-practices.js +0 -381
- package/packages/eslint-config-eser/rules/errors.js +0 -146
- package/packages/eslint-config-eser/rules/es6.js +0 -203
- package/packages/eslint-config-eser/rules/imports.js +0 -291
- package/packages/eslint-config-eser/rules/node.js +0 -43
- package/packages/eslint-config-eser/rules/strict.js +0 -5
- package/packages/eslint-config-eser/rules/style.js +0 -597
- package/packages/eslint-config-eser/rules/variables.js +0 -53
- package/packages/eslint-config-eser-react/.editorconfig +0 -14
- package/packages/eslint-config-eser-react/.eslintrc +0 -3
- package/packages/eslint-config-eser-react/README.md +0 -19
- package/packages/eslint-config-eser-react/index.js +0 -11
- package/packages/eslint-config-eser-react/package.json +0 -59
- package/packages/eslint-config-eser-react/rules/react-a11y.js +0 -275
- package/packages/eslint-config-eser-react/rules/react-hooks.js +0 -21
- package/packages/eslint-config-eser-react/rules/react.js +0 -600
- package/react/README.md +0 -717
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
env: {
|
|
3
|
-
es6: true,
|
|
4
|
-
},
|
|
5
|
-
|
|
6
|
-
parserOptions: {
|
|
7
|
-
ecmaVersion: 2018,
|
|
8
|
-
sourceType: 'module',
|
|
9
|
-
ecmaFeatures: {
|
|
10
|
-
generators: true,
|
|
11
|
-
objectLiteralDuplicateProperties: false,
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
rules: {
|
|
16
|
-
// enforces no braces where they can be omitted
|
|
17
|
-
// https://eslint.org/docs/rules/arrow-body-style
|
|
18
|
-
// TODO: enable requireReturnForObjectLiteral?
|
|
19
|
-
'arrow-body-style': [
|
|
20
|
-
'error',
|
|
21
|
-
'as-needed',
|
|
22
|
-
{
|
|
23
|
-
requireReturnForObjectLiteral: false,
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
|
|
27
|
-
// require parens in arrow function arguments
|
|
28
|
-
// https://eslint.org/docs/rules/arrow-parens
|
|
29
|
-
'arrow-parens': [
|
|
30
|
-
'error',
|
|
31
|
-
'as-needed',
|
|
32
|
-
{
|
|
33
|
-
requireForBlockBody: true,
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
|
|
37
|
-
// require space before/after arrow function's arrow
|
|
38
|
-
// https://eslint.org/docs/rules/arrow-spacing
|
|
39
|
-
'arrow-spacing': [ 'error', { before: true, after: true } ],
|
|
40
|
-
|
|
41
|
-
// verify super() callings in constructors
|
|
42
|
-
'constructor-super': 'error',
|
|
43
|
-
|
|
44
|
-
// enforce the spacing around the * in generator functions
|
|
45
|
-
// https://eslint.org/docs/rules/generator-star-spacing
|
|
46
|
-
'generator-star-spacing': [ 'error', { before: false, after: true } ],
|
|
47
|
-
|
|
48
|
-
// disallow modifying variables of class declarations
|
|
49
|
-
// https://eslint.org/docs/rules/no-class-assign
|
|
50
|
-
'no-class-assign': 'error',
|
|
51
|
-
|
|
52
|
-
// disallow arrow functions where they could be confused with comparisons
|
|
53
|
-
// https://eslint.org/docs/rules/no-confusing-arrow
|
|
54
|
-
'no-confusing-arrow': [ 'error', { allowParens: false } ],
|
|
55
|
-
|
|
56
|
-
// disallow modifying variables that are declared using const
|
|
57
|
-
'no-const-assign': 'error',
|
|
58
|
-
|
|
59
|
-
// disallow duplicate class members
|
|
60
|
-
// https://eslint.org/docs/rules/no-dupe-class-members
|
|
61
|
-
'no-dupe-class-members': 'error',
|
|
62
|
-
|
|
63
|
-
// disallow importing from the same path more than once
|
|
64
|
-
// https://eslint.org/docs/rules/no-duplicate-imports
|
|
65
|
-
// replaced by https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md
|
|
66
|
-
'no-duplicate-imports': 'off',
|
|
67
|
-
|
|
68
|
-
// disallow symbol constructor
|
|
69
|
-
// https://eslint.org/docs/rules/no-new-symbol
|
|
70
|
-
'no-new-symbol': 'error',
|
|
71
|
-
|
|
72
|
-
// disallow specific imports
|
|
73
|
-
// https://eslint.org/docs/rules/no-restricted-imports
|
|
74
|
-
'no-restricted-imports': [ 'off', { paths: [], patterns: [] } ],
|
|
75
|
-
|
|
76
|
-
// disallow to use this/super before super() calling in constructors.
|
|
77
|
-
// https://eslint.org/docs/rules/no-this-before-super
|
|
78
|
-
'no-this-before-super': 'error',
|
|
79
|
-
|
|
80
|
-
// disallow useless computed property keys
|
|
81
|
-
// https://eslint.org/docs/rules/no-useless-computed-key
|
|
82
|
-
'no-useless-computed-key': 'error',
|
|
83
|
-
|
|
84
|
-
// disallow unnecessary constructor
|
|
85
|
-
// https://eslint.org/docs/rules/no-useless-constructor
|
|
86
|
-
'no-useless-constructor': 'error',
|
|
87
|
-
|
|
88
|
-
// disallow renaming import, export, and destructured assignments to the same name
|
|
89
|
-
// https://eslint.org/docs/rules/no-useless-rename
|
|
90
|
-
'no-useless-rename': [
|
|
91
|
-
'error',
|
|
92
|
-
{
|
|
93
|
-
ignoreDestructuring: false,
|
|
94
|
-
ignoreImport: false,
|
|
95
|
-
ignoreExport: false,
|
|
96
|
-
},
|
|
97
|
-
],
|
|
98
|
-
|
|
99
|
-
// require let or const instead of var
|
|
100
|
-
'no-var': 'error',
|
|
101
|
-
|
|
102
|
-
// require method and property shorthand syntax for object literals
|
|
103
|
-
// https://eslint.org/docs/rules/object-shorthand
|
|
104
|
-
'object-shorthand': [
|
|
105
|
-
'error',
|
|
106
|
-
'consistent',
|
|
107
|
-
// {
|
|
108
|
-
// ignoreConstructors: false,
|
|
109
|
-
// avoidExplicitReturnArrows: false,
|
|
110
|
-
// avoidQuotes: true,
|
|
111
|
-
// },
|
|
112
|
-
],
|
|
113
|
-
|
|
114
|
-
// suggest using arrow functions as callbacks
|
|
115
|
-
'prefer-arrow-callback': [
|
|
116
|
-
'error',
|
|
117
|
-
{
|
|
118
|
-
allowNamedFunctions: false,
|
|
119
|
-
allowUnboundThis: true,
|
|
120
|
-
},
|
|
121
|
-
],
|
|
122
|
-
|
|
123
|
-
// suggest using of const declaration for variables that are never modified after declared
|
|
124
|
-
'prefer-const': [
|
|
125
|
-
'error',
|
|
126
|
-
{
|
|
127
|
-
destructuring: 'any',
|
|
128
|
-
ignoreReadBeforeAssign: true,
|
|
129
|
-
},
|
|
130
|
-
],
|
|
131
|
-
|
|
132
|
-
// Prefer destructuring from arrays and objects
|
|
133
|
-
// https://eslint.org/docs/rules/prefer-destructuring
|
|
134
|
-
'prefer-destructuring': [
|
|
135
|
-
'error',
|
|
136
|
-
{
|
|
137
|
-
VariableDeclarator: {
|
|
138
|
-
array: false,
|
|
139
|
-
object: true,
|
|
140
|
-
},
|
|
141
|
-
AssignmentExpression: {
|
|
142
|
-
array: true,
|
|
143
|
-
object: true,
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
enforceForRenamedProperties: false,
|
|
148
|
-
},
|
|
149
|
-
],
|
|
150
|
-
|
|
151
|
-
// disallow parseInt() in favor of binary, octal, and hexadecimal literals
|
|
152
|
-
// https://eslint.org/docs/rules/prefer-numeric-literals
|
|
153
|
-
'prefer-numeric-literals': 'error',
|
|
154
|
-
|
|
155
|
-
// suggest using Reflect methods where applicable
|
|
156
|
-
// https://eslint.org/docs/rules/prefer-reflect
|
|
157
|
-
'prefer-reflect': 'off',
|
|
158
|
-
|
|
159
|
-
// use rest parameters instead of arguments
|
|
160
|
-
// https://eslint.org/docs/rules/prefer-rest-params
|
|
161
|
-
'prefer-rest-params': 'error',
|
|
162
|
-
|
|
163
|
-
// suggest using the spread operator instead of .apply()
|
|
164
|
-
// https://eslint.org/docs/rules/prefer-spread
|
|
165
|
-
'prefer-spread': 'error',
|
|
166
|
-
|
|
167
|
-
// suggest using template literals instead of string concatenation
|
|
168
|
-
// https://eslint.org/docs/rules/prefer-template
|
|
169
|
-
'prefer-template': 'error',
|
|
170
|
-
|
|
171
|
-
// disallow generator functions that do not have yield
|
|
172
|
-
// https://eslint.org/docs/rules/require-yield
|
|
173
|
-
'require-yield': 'error',
|
|
174
|
-
|
|
175
|
-
// enforce spacing between object rest-spread
|
|
176
|
-
// https://eslint.org/docs/rules/rest-spread-spacing
|
|
177
|
-
'rest-spread-spacing': [ 'error', 'never' ],
|
|
178
|
-
|
|
179
|
-
// import sorting
|
|
180
|
-
// https://eslint.org/docs/rules/sort-imports
|
|
181
|
-
'sort-imports': [
|
|
182
|
-
'off',
|
|
183
|
-
{
|
|
184
|
-
ignoreCase: false,
|
|
185
|
-
ignoreDeclarationSort: false,
|
|
186
|
-
ignoreMemberSort: false,
|
|
187
|
-
memberSyntaxSortOrder: [ 'none', 'all', 'multiple', 'single' ],
|
|
188
|
-
},
|
|
189
|
-
],
|
|
190
|
-
|
|
191
|
-
// require a Symbol description
|
|
192
|
-
// https://eslint.org/docs/rules/symbol-description
|
|
193
|
-
'symbol-description': 'error',
|
|
194
|
-
|
|
195
|
-
// enforce usage of spacing in template strings
|
|
196
|
-
// https://eslint.org/docs/rules/template-curly-spacing
|
|
197
|
-
'template-curly-spacing': 'error',
|
|
198
|
-
|
|
199
|
-
// enforce spacing around the * in yield* expressions
|
|
200
|
-
// https://eslint.org/docs/rules/yield-star-spacing
|
|
201
|
-
'yield-star-spacing': [ 'error', 'after' ],
|
|
202
|
-
},
|
|
203
|
-
};
|
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
env: {
|
|
3
|
-
es6: true,
|
|
4
|
-
},
|
|
5
|
-
|
|
6
|
-
parserOptions: {
|
|
7
|
-
ecmaVersion: 6,
|
|
8
|
-
sourceType: 'module',
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
plugins: [
|
|
12
|
-
'import',
|
|
13
|
-
],
|
|
14
|
-
|
|
15
|
-
settings: {
|
|
16
|
-
'import/resolver': {
|
|
17
|
-
node: {
|
|
18
|
-
extensions: [ '.mjs', '.js', '.ts', '.json' ],
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
'import/extensions': [
|
|
22
|
-
'.mjs',
|
|
23
|
-
'.js',
|
|
24
|
-
'.jsx',
|
|
25
|
-
'.ts',
|
|
26
|
-
'.tsx',
|
|
27
|
-
],
|
|
28
|
-
'import/core-modules': [
|
|
29
|
-
],
|
|
30
|
-
'import/ignore': [
|
|
31
|
-
'node_modules',
|
|
32
|
-
'\\.(coffee|scss|css|less|hbs|svg|json)$',
|
|
33
|
-
],
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
rules: {
|
|
37
|
-
// Static analysis:
|
|
38
|
-
|
|
39
|
-
// ensure imports point to files/modules that can be resolved
|
|
40
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
|
|
41
|
-
'import/no-unresolved': [ 'error', { commonjs: true, caseSensitive: true } ],
|
|
42
|
-
|
|
43
|
-
// ensure named imports coupled with named exports
|
|
44
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/named.md#when-not-to-use-it
|
|
45
|
-
'import/named': 'error',
|
|
46
|
-
|
|
47
|
-
// ensure default import coupled with default export
|
|
48
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/default.md#when-not-to-use-it
|
|
49
|
-
'import/default': 'off',
|
|
50
|
-
|
|
51
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/namespace.md
|
|
52
|
-
'import/namespace': 'off',
|
|
53
|
-
|
|
54
|
-
// Helpful warnings:
|
|
55
|
-
|
|
56
|
-
// disallow invalid exports, e.g. multiple defaults
|
|
57
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/export.md
|
|
58
|
-
'import/export': 'error',
|
|
59
|
-
|
|
60
|
-
// do not allow a default import name to match a named export
|
|
61
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-named-as-default.md
|
|
62
|
-
'import/no-named-as-default': 'error',
|
|
63
|
-
|
|
64
|
-
// warn on accessing default export property names that are also named exports
|
|
65
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-named-as-default-member.md
|
|
66
|
-
'import/no-named-as-default-member': 'error',
|
|
67
|
-
|
|
68
|
-
// disallow use of jsdoc-marked-deprecated imports
|
|
69
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-deprecated.md
|
|
70
|
-
'import/no-deprecated': 'off',
|
|
71
|
-
|
|
72
|
-
// Forbid the use of extraneous packages
|
|
73
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
|
|
74
|
-
// paths are treated both as absolute paths, and relative to process.cwd()
|
|
75
|
-
'import/no-extraneous-dependencies': [
|
|
76
|
-
'warn',
|
|
77
|
-
{
|
|
78
|
-
devDependencies: [
|
|
79
|
-
'test/**', // tape, common npm pattern
|
|
80
|
-
'tests/**', // also common npm pattern
|
|
81
|
-
'spec/**', // mocha, rspec-like pattern
|
|
82
|
-
'**/__tests__/**', // jest pattern
|
|
83
|
-
'**/__mocks__/**', // jest pattern
|
|
84
|
-
'test.{js,jsx}', // repos with a single test file
|
|
85
|
-
'test-*.{js,jsx}', // repos with multiple top-level test files
|
|
86
|
-
'**/*{.,_}{test,spec}.{js,jsx}', // tests where the extension or filename suffix denotes that it is a test
|
|
87
|
-
'**/jest.config.js', // jest config
|
|
88
|
-
'**/jest.setup.js', // jest setup
|
|
89
|
-
'**/vue.config.js', // vue-cli config
|
|
90
|
-
'**/webpack.config.js', // webpack config
|
|
91
|
-
'**/webpack.config.*.js', // webpack config
|
|
92
|
-
'**/rollup.config.js', // rollup config
|
|
93
|
-
'**/rollup.config.*.js', // rollup config
|
|
94
|
-
'**/gulpfile.js', // gulp config
|
|
95
|
-
'**/gulpfile.*.js', // gulp config
|
|
96
|
-
'**/Gruntfile{,.js}', // grunt config
|
|
97
|
-
'**/protractor.conf.js', // protractor config
|
|
98
|
-
'**/protractor.conf.*.js', // protractor config
|
|
99
|
-
],
|
|
100
|
-
optionalDependencies: false,
|
|
101
|
-
},
|
|
102
|
-
],
|
|
103
|
-
|
|
104
|
-
// Forbid mutable exports
|
|
105
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-mutable-exports.md
|
|
106
|
-
'import/no-mutable-exports': 'error',
|
|
107
|
-
|
|
108
|
-
// Module systems:
|
|
109
|
-
|
|
110
|
-
// disallow require()
|
|
111
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-commonjs.md
|
|
112
|
-
'import/no-commonjs': 'off',
|
|
113
|
-
|
|
114
|
-
// disallow AMD require/define
|
|
115
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-amd.md
|
|
116
|
-
'import/no-amd': 'error',
|
|
117
|
-
|
|
118
|
-
// No Node.js builtin modules
|
|
119
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-nodejs-modules.md
|
|
120
|
-
// TODO: enable?
|
|
121
|
-
'import/no-nodejs-modules': 'off',
|
|
122
|
-
|
|
123
|
-
// Style guide:
|
|
124
|
-
|
|
125
|
-
// disallow non-import statements appearing before import statements
|
|
126
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/first.md
|
|
127
|
-
'import/first': [ 'error', 'absolute-first' ],
|
|
128
|
-
|
|
129
|
-
// disallow non-import statements appearing before import statements
|
|
130
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/imports-first.md
|
|
131
|
-
// deprecated: use `import/first`
|
|
132
|
-
'import/imports-first': 'off',
|
|
133
|
-
|
|
134
|
-
// disallow duplicate imports
|
|
135
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md
|
|
136
|
-
'import/no-duplicates': 'error',
|
|
137
|
-
|
|
138
|
-
// disallow namespace imports
|
|
139
|
-
// TODO: enable?
|
|
140
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-namespace.md
|
|
141
|
-
'import/no-namespace': 'off',
|
|
142
|
-
|
|
143
|
-
// Ensure consistent use of file extension within the import path
|
|
144
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md
|
|
145
|
-
'import/extensions': [
|
|
146
|
-
'error',
|
|
147
|
-
'ignorePackages',
|
|
148
|
-
{
|
|
149
|
-
js: 'never',
|
|
150
|
-
mjs: 'never',
|
|
151
|
-
jsx: 'never',
|
|
152
|
-
},
|
|
153
|
-
],
|
|
154
|
-
|
|
155
|
-
// ensure absolute imports are above relative imports and that unassigned imports
|
|
156
|
-
// are ignored
|
|
157
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md
|
|
158
|
-
'import/order': [
|
|
159
|
-
'off',
|
|
160
|
-
{
|
|
161
|
-
'groups': [
|
|
162
|
-
'builtin',
|
|
163
|
-
'external',
|
|
164
|
-
'internal',
|
|
165
|
-
'parent',
|
|
166
|
-
'sibling',
|
|
167
|
-
'index',
|
|
168
|
-
],
|
|
169
|
-
'newlines-between': 'never',
|
|
170
|
-
},
|
|
171
|
-
],
|
|
172
|
-
|
|
173
|
-
// Require a newline after the last import/require in a group
|
|
174
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/newline-after-import.md
|
|
175
|
-
'import/newline-after-import': 'error',
|
|
176
|
-
|
|
177
|
-
// Require modules with a single export to use a default export
|
|
178
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/prefer-default-export.md
|
|
179
|
-
'import/prefer-default-export': 'error',
|
|
180
|
-
|
|
181
|
-
// Restrict which files can be imported in a given folder
|
|
182
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-restricted-paths.md
|
|
183
|
-
'import/no-restricted-paths': 'off',
|
|
184
|
-
|
|
185
|
-
// Forbid modules to have too many dependencies
|
|
186
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/max-dependencies.md
|
|
187
|
-
'import/max-dependencies': [ 'off', { max: 10 } ],
|
|
188
|
-
|
|
189
|
-
// Forbid import of modules using absolute paths
|
|
190
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-absolute-path.md
|
|
191
|
-
'import/no-absolute-path': 'error',
|
|
192
|
-
|
|
193
|
-
// Forbid require() calls with expressions
|
|
194
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-dynamic-require.md
|
|
195
|
-
'import/no-dynamic-require': 'error',
|
|
196
|
-
|
|
197
|
-
// prevent importing the submodules of other modules
|
|
198
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-internal-modules.md
|
|
199
|
-
'import/no-internal-modules': [ 'off', { allow: [] } ],
|
|
200
|
-
|
|
201
|
-
// Warn if a module could be mistakenly parsed as a script by a consumer
|
|
202
|
-
// leveraging Unambiguous JavaScript Grammar
|
|
203
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/unambiguous.md
|
|
204
|
-
// this should not be enabled until this proposal has at least been *presented* to TC39.
|
|
205
|
-
// At the moment, it's not a thing.
|
|
206
|
-
'import/unambiguous': 'off',
|
|
207
|
-
|
|
208
|
-
// Forbid Webpack loader syntax in imports
|
|
209
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-webpack-loader-syntax.md
|
|
210
|
-
'import/no-webpack-loader-syntax': 'error',
|
|
211
|
-
|
|
212
|
-
// Prevent unassigned imports
|
|
213
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unassigned-import.md
|
|
214
|
-
// importing for side effects is perfectly acceptable, if you need side effects.
|
|
215
|
-
'import/no-unassigned-import': 'off',
|
|
216
|
-
|
|
217
|
-
// Prevent importing the default as if it were named
|
|
218
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-named-default.md
|
|
219
|
-
'import/no-named-default': 'error',
|
|
220
|
-
|
|
221
|
-
// Reports if a module's default export is unnamed
|
|
222
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/d9b712ac7fd1fddc391f7b234827925c160d956f/docs/rules/no-anonymous-default-export.md
|
|
223
|
-
'import/no-anonymous-default-export': [
|
|
224
|
-
'off',
|
|
225
|
-
{
|
|
226
|
-
allowArray: false,
|
|
227
|
-
allowArrowFunction: false,
|
|
228
|
-
allowAnonymousClass: false,
|
|
229
|
-
allowAnonymousFunction: false,
|
|
230
|
-
allowLiteral: false,
|
|
231
|
-
allowObject: false,
|
|
232
|
-
},
|
|
233
|
-
],
|
|
234
|
-
|
|
235
|
-
// This rule enforces that all exports are declared at the bottom of the file.
|
|
236
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/98acd6afd04dcb6920b81330114e146dc8532ea4/docs/rules/exports-last.md
|
|
237
|
-
'import/exports-last': 'warn',
|
|
238
|
-
|
|
239
|
-
// Reports when named exports are not grouped together in a single export declaration
|
|
240
|
-
// or when multiple assignments to CommonJS module.exports or exports object are present
|
|
241
|
-
// in a single file.
|
|
242
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/group-exports.md
|
|
243
|
-
'import/group-exports': 'warn',
|
|
244
|
-
|
|
245
|
-
// forbid default exports. this is a terrible rule, do not use it.
|
|
246
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-default-export.md
|
|
247
|
-
'import/no-default-export': 'off',
|
|
248
|
-
|
|
249
|
-
// Prohibit named exports. this is a terrible rule, do not use it.
|
|
250
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/1ec80fa35fa1819e2d35a70e68fb6a149fb57c5e/docs/rules/no-named-export.md
|
|
251
|
-
'import/no-named-export': 'off',
|
|
252
|
-
|
|
253
|
-
// Forbid a module from importing itself
|
|
254
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-self-import.md
|
|
255
|
-
'import/no-self-import': 'error',
|
|
256
|
-
|
|
257
|
-
// Forbid cyclical dependencies between modules
|
|
258
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/d81f48a2506182738409805f5272eff4d77c9348/docs/rules/no-cycle.md
|
|
259
|
-
'import/no-cycle': [ 'error', { maxDepth: Infinity } ],
|
|
260
|
-
|
|
261
|
-
// Ensures that there are no useless path segments
|
|
262
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/ebafcbf59ec9f653b2ac2a0156ca3bcba0a7cf57/docs/rules/no-useless-path-segments.md
|
|
263
|
-
'import/no-useless-path-segments': [ 'error', { commonjs: true } ],
|
|
264
|
-
|
|
265
|
-
// dynamic imports require a leading comment with a webpackChunkName
|
|
266
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/ebafcbf59ec9f653b2ac2a0156ca3bcba0a7cf57/docs/rules/dynamic-import-chunkname.md
|
|
267
|
-
'import/dynamic-import-chunkname': [
|
|
268
|
-
'off',
|
|
269
|
-
{
|
|
270
|
-
importFunctions: [],
|
|
271
|
-
webpackChunknameFormat: '[0-9a-zA-Z-_/.]+',
|
|
272
|
-
},
|
|
273
|
-
],
|
|
274
|
-
|
|
275
|
-
// Use this rule to prevent imports to folders in relative parent paths.
|
|
276
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/c34f14f67f077acd5a61b3da9c0b0de298d20059/docs/rules/no-relative-parent-imports.md
|
|
277
|
-
'import/no-relative-parent-imports': 'off',
|
|
278
|
-
|
|
279
|
-
// Reports modules without any exports, or with unused exports
|
|
280
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/f63dd261809de6883b13b6b5b960e6d7f42a7813/docs/rules/no-unused-modules.md
|
|
281
|
-
// this rule does not work with module.exports
|
|
282
|
-
'import/no-unused-modules': [
|
|
283
|
-
'off',
|
|
284
|
-
// {
|
|
285
|
-
// ignoreExports: [],
|
|
286
|
-
// missingExports: true,
|
|
287
|
-
// unusedExports: true,
|
|
288
|
-
// },
|
|
289
|
-
],
|
|
290
|
-
},
|
|
291
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
env: {
|
|
3
|
-
node: true,
|
|
4
|
-
},
|
|
5
|
-
|
|
6
|
-
rules: {
|
|
7
|
-
// enforce return after a callback
|
|
8
|
-
'callback-return': 'off',
|
|
9
|
-
|
|
10
|
-
// require all requires be top-level
|
|
11
|
-
// https://eslint.org/docs/rules/global-require
|
|
12
|
-
'global-require': 'error',
|
|
13
|
-
|
|
14
|
-
// enforces error handling in callbacks (node environment)
|
|
15
|
-
'handle-callback-err': 'off',
|
|
16
|
-
|
|
17
|
-
// disallow use of the Buffer() constructor
|
|
18
|
-
// https://eslint.org/docs/rules/no-buffer-constructor
|
|
19
|
-
'no-buffer-constructor': 'error',
|
|
20
|
-
|
|
21
|
-
// disallow mixing regular variable and require declarations
|
|
22
|
-
'no-mixed-requires': [ 'off', false ],
|
|
23
|
-
|
|
24
|
-
// disallow use of new operator with the require function
|
|
25
|
-
'no-new-require': 'error',
|
|
26
|
-
|
|
27
|
-
// disallow string concatenation with __dirname and __filename
|
|
28
|
-
// https://eslint.org/docs/rules/no-path-concat
|
|
29
|
-
'no-path-concat': 'error',
|
|
30
|
-
|
|
31
|
-
// disallow use of process.env
|
|
32
|
-
'no-process-env': 'off',
|
|
33
|
-
|
|
34
|
-
// disallow process.exit()
|
|
35
|
-
'no-process-exit': 'off',
|
|
36
|
-
|
|
37
|
-
// restrict usage of specified node modules
|
|
38
|
-
'no-restricted-modules': 'off',
|
|
39
|
-
|
|
40
|
-
// disallow use of synchronous methods (off by default)
|
|
41
|
-
'no-sync': 'off',
|
|
42
|
-
},
|
|
43
|
-
};
|