@vinicunca/eslint-config 1.2.7

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.
@@ -0,0 +1,19 @@
1
+ const { defineConfig } = require('eslint-define-config');
2
+
3
+ module.exports = defineConfig({
4
+ extends: ['plugin:react/recommended', './typescript.eslint.js'],
5
+
6
+ settings: {
7
+ react: {
8
+ version: '17.0',
9
+ },
10
+ },
11
+
12
+ rules: {
13
+ 'jsx-quotes': ['error', 'prefer-double'],
14
+ 'react/react-in-jsx-scope': 'off',
15
+ 'react/display-name': 'off',
16
+ 'react/no-unknown-property': ['error', { ignore: ['class'] }],
17
+ 'react/jsx-curly-spacing': ['error', { when: 'always', children: true }],
18
+ },
19
+ });
@@ -0,0 +1,317 @@
1
+ // Inline from https://github.com/standard/eslint-config-standard/blob/master/.eslintrc.json
2
+ // Until it upgrades
3
+
4
+ module.exports = {
5
+ parserOptions: {
6
+ ecmaVersion: 2022,
7
+ ecmaFeatures: {
8
+ jsx: true,
9
+ },
10
+ sourceType: 'module',
11
+ },
12
+ env: {
13
+ es2021: true,
14
+ node: true,
15
+ },
16
+ plugins: [
17
+ 'import', 'n', 'promise',
18
+ ],
19
+ globals: {
20
+ document: 'readonly',
21
+ navigator: 'readonly',
22
+ window: 'readonly',
23
+ },
24
+ rules: {
25
+ 'no-var': 'warn',
26
+ 'object-shorthand': ['warn', 'properties'],
27
+
28
+ 'accessor-pairs': ['error', { setWithoutGet: true, enforceForClassMembers: true }],
29
+ 'array-bracket-spacing': ['error', 'never'],
30
+ 'array-bracket-newline': ['error', { multiline: true, minItems: 3 }],
31
+ 'array-callback-return': [
32
+ 'error',
33
+ {
34
+ allowImplicit: false,
35
+ checkForEach: false,
36
+ },
37
+ ],
38
+ 'arrow-spacing': ['error', { before: true, after: true }],
39
+ 'block-spacing': ['error', 'always'],
40
+ 'brace-style': [
41
+ 'error', '1tbs', { allowSingleLine: true },
42
+ ],
43
+ 'camelcase': [
44
+ 'error',
45
+ {
46
+ allow: ['^UNSAFE_'],
47
+ properties: 'never',
48
+ ignoreGlobals: true,
49
+ },
50
+ ],
51
+ 'comma-dangle': [
52
+ 'error',
53
+ {
54
+ arrays: 'never',
55
+ objects: 'never',
56
+ imports: 'never',
57
+ exports: 'never',
58
+ functions: 'never',
59
+ },
60
+ ],
61
+ 'comma-spacing': ['error', { before: false, after: true }],
62
+ 'comma-style': ['error', 'last'],
63
+ 'computed-property-spacing': [
64
+ 'error', 'never', { enforceForClassMembers: true },
65
+ ],
66
+ 'constructor-super': 'error',
67
+ 'curly': ['error', 'multi-line'],
68
+ 'default-case-last': 'error',
69
+ 'dot-location': ['error', 'property'],
70
+ 'dot-notation': ['error', { allowKeywords: true }],
71
+ 'eol-last': 'error',
72
+ 'eqeqeq': [
73
+ 'error', 'always', { null: 'ignore' },
74
+ ],
75
+ 'func-call-spacing': ['error', 'never'],
76
+ 'generator-star-spacing': ['error', { before: true, after: true }],
77
+ 'indent': [
78
+ 'error',
79
+ 2,
80
+ {
81
+ SwitchCase: 1,
82
+ VariableDeclarator: 1,
83
+ outerIIFEBody: 1,
84
+ MemberExpression: 1,
85
+ FunctionDeclaration: { parameters: 1, body: 1 },
86
+ FunctionExpression: { parameters: 1, body: 1 },
87
+ CallExpression: { arguments: 1 },
88
+ ArrayExpression: 1,
89
+ ObjectExpression: 1,
90
+ ImportDeclaration: 1,
91
+ flatTernaryExpressions: false,
92
+ ignoreComments: false,
93
+ ignoredNodes: [
94
+ 'TemplateLiteral *',
95
+ 'JSXElement',
96
+ 'JSXElement > *',
97
+ 'JSXAttribute',
98
+ 'JSXIdentifier',
99
+ 'JSXNamespacedName',
100
+ 'JSXMemberExpression',
101
+ 'JSXSpreadAttribute',
102
+ 'JSXExpressionContainer',
103
+ 'JSXOpeningElement',
104
+ 'JSXClosingElement',
105
+ 'JSXFragment',
106
+ 'JSXOpeningFragment',
107
+ 'JSXClosingFragment',
108
+ 'JSXText',
109
+ 'JSXEmptyExpression',
110
+ 'JSXSpreadChild',
111
+ ],
112
+ offsetTernaryExpressions: true,
113
+ },
114
+ ],
115
+ 'key-spacing': ['error', { beforeColon: false, afterColon: true }],
116
+ 'keyword-spacing': ['error', { before: true, after: true }],
117
+ 'lines-between-class-members': [
118
+ 'error', 'always', { exceptAfterSingleLine: true },
119
+ ],
120
+ 'multiline-ternary': ['error', 'always-multiline'],
121
+ 'new-cap': ['error', { newIsCap: true, capIsNew: false, properties: true }],
122
+ 'new-parens': 'error',
123
+ 'no-array-constructor': 'error',
124
+ 'no-async-promise-executor': 'error',
125
+ 'no-caller': 'error',
126
+ 'no-case-declarations': 'error',
127
+ 'no-class-assign': 'error',
128
+ 'no-compare-neg-zero': 'error',
129
+ 'no-cond-assign': 'error',
130
+ 'no-const-assign': 'error',
131
+ 'no-constant-condition': ['error', { checkLoops: false }],
132
+ 'no-control-regex': 'error',
133
+ 'no-debugger': 'error',
134
+ 'no-delete-var': 'error',
135
+ 'no-dupe-args': 'error',
136
+ 'no-dupe-class-members': 'error',
137
+ 'no-dupe-keys': 'error',
138
+ 'no-duplicate-case': 'error',
139
+ 'no-useless-backreference': 'error',
140
+ 'no-empty': ['error', { allowEmptyCatch: true }],
141
+ 'no-empty-character-class': 'error',
142
+ 'no-empty-pattern': 'error',
143
+ 'no-eval': 'error',
144
+ 'no-ex-assign': 'error',
145
+ 'no-extend-native': 'error',
146
+ 'no-extra-bind': 'error',
147
+ 'no-extra-boolean-cast': 'error',
148
+ 'no-extra-parens': ['error', 'functions'],
149
+ 'no-fallthrough': 'error',
150
+ 'no-floating-decimal': 'error',
151
+ 'no-func-assign': 'error',
152
+ 'no-global-assign': 'error',
153
+ 'no-implied-eval': 'error',
154
+ 'no-import-assign': 'error',
155
+ 'no-invalid-regexp': 'error',
156
+ 'no-irregular-whitespace': 'error',
157
+ 'no-iterator': 'error',
158
+ 'no-labels': ['error', { allowLoop: false, allowSwitch: false }],
159
+ 'no-lone-blocks': 'error',
160
+ 'no-loss-of-precision': 'error',
161
+ 'no-misleading-character-class': 'error',
162
+ 'no-prototype-builtins': 'error',
163
+ 'no-useless-catch': 'error',
164
+ 'no-mixed-operators': [
165
+ 'error',
166
+ {
167
+ groups: [
168
+ [
169
+ '==', '!=', '===', '!==', '>', '>=', '<', '<=',
170
+ ],
171
+ ['&&', '||'],
172
+ ['in', 'instanceof'],
173
+ ],
174
+ allowSamePrecedence: true,
175
+ },
176
+ ],
177
+ 'no-mixed-spaces-and-tabs': 'error',
178
+ 'no-multi-spaces': 'error',
179
+ 'no-multi-str': 'error',
180
+ 'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }],
181
+ 'no-new': 'error',
182
+ 'no-new-func': 'error',
183
+ 'no-new-object': 'error',
184
+ 'no-new-symbol': 'error',
185
+ 'no-new-wrappers': 'error',
186
+ 'no-obj-calls': 'error',
187
+ 'no-octal': 'error',
188
+ 'no-octal-escape': 'error',
189
+ 'no-proto': 'error',
190
+ 'no-redeclare': ['error', { builtinGlobals: false }],
191
+ 'no-regex-spaces': 'error',
192
+ 'no-return-assign': ['error', 'except-parens'],
193
+ 'no-self-assign': ['error', { props: true }],
194
+ 'no-self-compare': 'error',
195
+ 'no-sequences': 'error',
196
+ 'no-shadow-restricted-names': 'error',
197
+ 'no-sparse-arrays': 'error',
198
+ 'no-tabs': 'error',
199
+ 'no-template-curly-in-string': 'error',
200
+ 'no-this-before-super': 'error',
201
+ 'no-throw-literal': 'error',
202
+ 'no-trailing-spaces': 'error',
203
+ 'no-undef': 'error',
204
+ 'no-undef-init': 'error',
205
+ 'no-unexpected-multiline': 'error',
206
+ 'no-unmodified-loop-condition': 'error',
207
+ 'no-unneeded-ternary': ['error', { defaultAssignment: false }],
208
+ 'no-unreachable': 'error',
209
+ 'no-unreachable-loop': 'error',
210
+ 'no-unsafe-finally': 'error',
211
+ 'no-unsafe-negation': 'error',
212
+ 'no-unused-expressions': [
213
+ 'error',
214
+ {
215
+ allowShortCircuit: true,
216
+ allowTernary: true,
217
+ allowTaggedTemplates: true,
218
+ },
219
+ ],
220
+ 'no-unused-vars': [
221
+ 'error',
222
+ {
223
+ args: 'none',
224
+ caughtErrors: 'none',
225
+ ignoreRestSiblings: true,
226
+ vars: 'all',
227
+ },
228
+ ],
229
+ 'no-use-before-define': ['error', { functions: false, classes: false, variables: false }],
230
+ 'no-useless-call': 'error',
231
+ 'no-useless-computed-key': 'error',
232
+ 'no-useless-constructor': 'error',
233
+ 'no-useless-escape': 'error',
234
+ 'no-useless-rename': 'error',
235
+ 'no-useless-return': 'error',
236
+ 'no-void': 'error',
237
+ 'no-whitespace-before-property': 'error',
238
+ 'no-with': 'error',
239
+ 'object-curly-newline': ['error', { multiline: true, consistent: true }],
240
+ 'object-curly-spacing': ['error', 'always'],
241
+ 'object-property-newline': ['error', { allowMultiplePropertiesPerLine: true }],
242
+ 'one-var': ['error', { initialized: 'never' }],
243
+ 'operator-linebreak': [
244
+ 'error',
245
+ 'after',
246
+ { overrides: { '?': 'before', ':': 'before', '|>': 'before' } },
247
+ ],
248
+ 'padded-blocks': ['error', { blocks: 'never', switches: 'never', classes: 'never' }],
249
+ 'prefer-const': ['error', { destructuring: 'all' }],
250
+ 'prefer-promise-reject-errors': 'error',
251
+ 'prefer-regex-literals': ['error', { disallowRedundantWrapping: true }],
252
+ 'quote-props': ['error', 'as-needed'],
253
+ 'quotes': [
254
+ 'error', 'single', { avoidEscape: true, allowTemplateLiterals: false },
255
+ ],
256
+ 'rest-spread-spacing': ['error', 'never'],
257
+ 'semi': ['error', 'never'],
258
+ 'semi-spacing': ['error', { before: false, after: true }],
259
+ 'space-before-blocks': ['error', 'always'],
260
+ 'space-before-function-paren': ['error', 'always'],
261
+ 'space-in-parens': ['error', 'never'],
262
+ 'space-infix-ops': 'error',
263
+ 'space-unary-ops': ['error', { words: true, nonwords: false }],
264
+ 'spaced-comment': [
265
+ 'error',
266
+ 'always',
267
+ {
268
+ line: {
269
+ markers: [
270
+ '*package', '!', '/', ',', '=',
271
+ ],
272
+ },
273
+ block: {
274
+ balanced: true,
275
+ markers: [
276
+ '*package', '!', ',', ':', '::', 'flow-include',
277
+ ],
278
+ exceptions: ['*'],
279
+ },
280
+ },
281
+ ],
282
+ 'symbol-description': 'error',
283
+ 'template-curly-spacing': ['error', 'never'],
284
+ 'template-tag-spacing': ['error', 'never'],
285
+ 'unicode-bom': ['error', 'never'],
286
+ 'use-isnan': [
287
+ 'error',
288
+ {
289
+ enforceForSwitchCase: true,
290
+ enforceForIndexOf: true,
291
+ },
292
+ ],
293
+ 'valid-typeof': ['error', { requireStringLiterals: true }],
294
+ 'wrap-iife': [
295
+ 'error', 'any', { functionPrototypeMethods: true },
296
+ ],
297
+ 'yield-star-spacing': ['error', 'both'],
298
+ 'yoda': ['error', 'never'],
299
+
300
+ 'import/export': 'error',
301
+ 'import/first': 'error',
302
+ 'import/no-absolute-path': ['error', { esmodule: true, commonjs: true, amd: false }],
303
+ 'import/no-duplicates': 'error',
304
+ 'import/no-named-default': 'error',
305
+ 'import/no-webpack-loader-syntax': 'error',
306
+
307
+ 'n/handle-callback-err': ['error', '^(err|error)$'],
308
+ 'n/no-callback-literal': 'error',
309
+ 'n/no-deprecated-api': 'error',
310
+ 'n/no-exports-assign': 'error',
311
+ 'n/no-new-require': 'error',
312
+ 'n/no-path-concat': 'error',
313
+ 'n/process-exit-as-throw': 'error',
314
+
315
+ 'promise/param-names': 'error',
316
+ },
317
+ };
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ extends: ['stylelint-config-standard'],
3
+
4
+ // add your custom config here
5
+ // https://stylelint.io/user-guide/configuration
6
+ rules: {},
7
+ };
@@ -0,0 +1,109 @@
1
+ const { defineConfig } = require('eslint-define-config');
2
+
3
+ const base = require('./base.eslint');
4
+
5
+ module.exports = defineConfig({
6
+ extends: [
7
+ './base.eslint.js',
8
+ 'plugin:import/typescript',
9
+ 'plugin:@typescript-eslint/recommended',
10
+ ],
11
+
12
+ overrides: base.overrides,
13
+
14
+ rules: {
15
+ 'import/named': 'off',
16
+ 'import/order': [
17
+ 'error', {
18
+ 'groups': [
19
+ 'type', 'builtin', 'external', 'internal', ['parent', 'sibling'], 'object', 'index',
20
+ ],
21
+ 'newlines-between': 'always',
22
+ },
23
+ ],
24
+
25
+ // TS
26
+ '@typescript-eslint/semi': ['error', 'always'],
27
+ '@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }],
28
+ '@typescript-eslint/member-delimiter-style': ['error'],
29
+ '@typescript-eslint/type-annotation-spacing': ['error', {}],
30
+ '@typescript-eslint/consistent-type-imports': [
31
+ 'error',
32
+ { prefer: 'type-imports', disallowTypeAnnotations: false },
33
+ ],
34
+ '@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
35
+ '@typescript-eslint/consistent-indexed-object-style': ['error', 'record'],
36
+ '@typescript-eslint/prefer-ts-expect-error': 'error',
37
+
38
+ // Override JS
39
+ 'no-useless-constructor': 'off',
40
+ 'indent': 'off',
41
+ '@typescript-eslint/indent': [
42
+ 'error', 2, {
43
+ SwitchCase: 1,
44
+ VariableDeclarator: 1,
45
+ outerIIFEBody: 1,
46
+ MemberExpression: 1,
47
+ FunctionDeclaration: { parameters: 1, body: 1 },
48
+ FunctionExpression: { parameters: 1, body: 1 },
49
+ CallExpression: { arguments: 1 },
50
+ ArrayExpression: 1,
51
+ ObjectExpression: 1,
52
+ ImportDeclaration: 1,
53
+ flatTernaryExpressions: false,
54
+ ignoreComments: false,
55
+ ignoredNodes: [
56
+ 'TemplateLiteral *',
57
+ 'JSXElement',
58
+ 'JSXElement > *',
59
+ 'JSXAttribute',
60
+ 'JSXIdentifier',
61
+ 'JSXNamespacedName',
62
+ 'JSXMemberExpression',
63
+ 'JSXSpreadAttribute',
64
+ 'JSXExpressionContainer',
65
+ 'JSXOpeningElement',
66
+ 'JSXClosingElement',
67
+ 'JSXFragment',
68
+ 'JSXOpeningFragment',
69
+ 'JSXClosingFragment',
70
+ 'JSXText',
71
+ 'JSXEmptyExpression',
72
+ 'JSXSpreadChild',
73
+ 'TSTypeParameterInstantiation',
74
+ ],
75
+ offsetTernaryExpressions: true,
76
+ },
77
+ ],
78
+
79
+ 'no-unused-vars': 'off',
80
+ '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_' }],
81
+ 'no-redeclare': 'off',
82
+ '@typescript-eslint/no-redeclare': 'error',
83
+ 'no-use-before-define': 'off',
84
+ '@typescript-eslint/no-use-before-define': [
85
+ 'error',
86
+ { functions: false, classes: false, variables: true },
87
+ ],
88
+ 'brace-style': 'off',
89
+ '@typescript-eslint/brace-style': ['error', '1tbs'],
90
+ 'comma-dangle': 'off',
91
+ '@typescript-eslint/comma-dangle': ['error', 'always-multiline'],
92
+ 'object-curly-spacing': 'off',
93
+ '@typescript-eslint/object-curly-spacing': ['error', 'always'],
94
+
95
+ // off
96
+ '@typescript-eslint/camelcase': 'off',
97
+ '@typescript-eslint/explicit-function-return-type': 'off',
98
+ '@typescript-eslint/explicit-member-accessibility': 'off',
99
+ '@typescript-eslint/no-explicit-any': 'off',
100
+ '@typescript-eslint/no-parameter-properties': 'off',
101
+ '@typescript-eslint/no-empty-interface': 'off',
102
+ '@typescript-eslint/ban-ts-ignore': 'off',
103
+ '@typescript-eslint/no-empty-function': 'off',
104
+ '@typescript-eslint/no-non-null-assertion': 'off',
105
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
106
+ '@typescript-eslint/ban-types': 'off',
107
+ '@typescript-eslint/no-namespace': 'off',
108
+ },
109
+ });
package/vue.eslint.js ADDED
@@ -0,0 +1,37 @@
1
+ const { defineConfig } = require('eslint-define-config');
2
+
3
+ module.exports = defineConfig({
4
+ extends: ['plugin:vue/vue3-recommended', './typescript.eslint.js'],
5
+
6
+ overrides: [
7
+ {
8
+ files: ['*.vue'],
9
+ parser: 'vue-eslint-parser',
10
+ parserOptions: {
11
+ parser: '@typescript-eslint/parser',
12
+ },
13
+ rules: {
14
+ 'no-unused-vars': 'off',
15
+ 'no-undef': 'off',
16
+ '@typescript-eslint/no-unused-vars': 'off',
17
+ },
18
+ },
19
+ ],
20
+
21
+ rules: {
22
+ 'vue/max-attributes-per-line': ['warn', { singleline: 5 }],
23
+ 'vue/html-self-closing': 'off',
24
+ 'vue/no-v-html': 'off',
25
+ 'vue/require-prop-types': 'off',
26
+ 'vue/require-default-prop': 'off',
27
+ 'vue/multi-word-component-names': 'off',
28
+
29
+ 'vue/component-tags-order': [
30
+ 'error', {
31
+ order: [
32
+ 'script', 'template', 'style',
33
+ ],
34
+ },
35
+ ],
36
+ },
37
+ });