@santi020k/eslint-config-santi020k 1.2.2 → 2.0.1
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/README.md +86 -111
- package/dist/configs/astro/index.config.d.ts +9 -0
- package/dist/configs/astro/rules.d.ts +6 -0
- package/dist/configs/expo/index.config.d.ts +9 -0
- package/dist/configs/expo/rules.d.ts +6 -0
- package/dist/configs/index.d.ts +6 -0
- package/dist/configs/js/index.config.d.ts +3 -0
- package/dist/configs/js/rules.d.ts +4 -0
- package/dist/configs/next/index.config.d.ts +9 -0
- package/dist/configs/next/rules.d.ts +6 -0
- package/dist/configs/react/index.config.d.ts +11 -0
- package/dist/configs/react/rules.d.ts +3 -0
- package/dist/configs/ts/index.config.d.ts +3 -0
- package/dist/configs/ts/rules.d.ts +25 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +466 -0
- package/dist/index.mjs +466 -0
- package/dist/optionals/cspell.d.ts +15 -0
- package/dist/optionals/i18next.d.ts +2 -0
- package/dist/optionals/index.d.ts +5 -0
- package/dist/optionals/mdx.d.ts +21 -0
- package/dist/optionals/tailwind.d.ts +2 -0
- package/dist/optionals/vitest.d.ts +16 -0
- package/dist/package.json +104 -0
- package/dist/utils/flatCompat.d.ts +6 -0
- package/package.json +40 -30
- package/dist/cjs/index.cjs +0 -443
- package/dist/esm/index.mjs +0 -434
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
import { FlatCompat } from '@eslint/eslintrc';
|
|
2
|
+
import { getDirname } from 'cross-dirname';
|
|
3
|
+
import { fixupConfigRules } from '@eslint/compat';
|
|
4
|
+
import eslint from '@eslint/js';
|
|
5
|
+
import pluginStylistic from '@stylistic/eslint-plugin';
|
|
6
|
+
import configStandard from 'eslint-config-standard';
|
|
7
|
+
import pluginImport from 'eslint-plugin-import';
|
|
8
|
+
import pluginJsxA11y from 'eslint-plugin-jsx-a11y';
|
|
9
|
+
import pluginN from 'eslint-plugin-n';
|
|
10
|
+
import pluginPromise from 'eslint-plugin-promise';
|
|
11
|
+
import pluginSimpleImport from 'eslint-plugin-simple-import-sort';
|
|
12
|
+
import pluginSonarJs from 'eslint-plugin-sonarjs';
|
|
13
|
+
import pluginUnusedImport from 'eslint-plugin-unused-imports';
|
|
14
|
+
import globals from 'globals';
|
|
15
|
+
import pluginReactConfig from 'eslint-plugin-react/configs/recommended.js';
|
|
16
|
+
import pluginReactHooks from 'eslint-plugin-react-hooks';
|
|
17
|
+
import tsEslint from 'typescript-eslint';
|
|
18
|
+
import pluginCspell from '@cspell/eslint-plugin';
|
|
19
|
+
import pluginTailwind from 'eslint-plugin-tailwindcss';
|
|
20
|
+
import pluginVitest from 'eslint-plugin-vitest';
|
|
21
|
+
|
|
22
|
+
/******************************************************************************
|
|
23
|
+
Copyright (c) Microsoft Corporation.
|
|
24
|
+
|
|
25
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
26
|
+
purpose with or without fee is hereby granted.
|
|
27
|
+
|
|
28
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
29
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
30
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
31
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
32
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
33
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
34
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
35
|
+
***************************************************************************** */
|
|
36
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
var __assign = function() {
|
|
40
|
+
__assign = Object.assign || function __assign(t) {
|
|
41
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
42
|
+
s = arguments[i];
|
|
43
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
44
|
+
}
|
|
45
|
+
return t;
|
|
46
|
+
};
|
|
47
|
+
return __assign.apply(this, arguments);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
function __spreadArray(to, from, pack) {
|
|
51
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
52
|
+
if (ar || !(i in from)) {
|
|
53
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
54
|
+
ar[i] = from[i];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
61
|
+
var e = new Error(message);
|
|
62
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// Initialize FlatCompat with the base directory and recommended configurations
|
|
66
|
+
var flatCompat = new FlatCompat({
|
|
67
|
+
baseDirectory: getDirname(),
|
|
68
|
+
recommendedConfig: {}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
var groups = [
|
|
72
|
+
// Internal packages.
|
|
73
|
+
// Atomic Design and components
|
|
74
|
+
['^(components|@/components|@components)(/.*|$)'],
|
|
75
|
+
['^(ui|@/ui|@ui)(/.*|$)'],
|
|
76
|
+
['^(atoms|@/atoms|@atoms)(/.*|$)'],
|
|
77
|
+
['^(molecules|@/molecules|@molecules)(/.*|$)'],
|
|
78
|
+
['^(organisms|@/organisms|@organisms)(/.*|$)'],
|
|
79
|
+
['^(templates|@/templates|@templates)(/.*|$)'],
|
|
80
|
+
['^(pages|@/pages|@pages)(/.*|$)'],
|
|
81
|
+
// Other posible folders
|
|
82
|
+
['^(store|@/store|@store)(/.*|$)'],
|
|
83
|
+
['^(api|@/api|@api)(/.*|$)'],
|
|
84
|
+
['^(contexts|@/contexts|@contexts)(/.*|$)'],
|
|
85
|
+
['^(hooks|@/hooks|@hooks)(/.*|$)'],
|
|
86
|
+
['^(lib|@/lib|@lib)(/.*|$)'],
|
|
87
|
+
['^(services|@/services|@services)(/.*|$)'],
|
|
88
|
+
['^(models|@/models|@models)(/.*|$)'],
|
|
89
|
+
['^(utils|@/utils|@utils)(/.*|$)'],
|
|
90
|
+
['^(ws|@/ws|@ws)(/.*|$)'],
|
|
91
|
+
// npm packages
|
|
92
|
+
// Anything that starts with a letter (or digit or underscore), or `@` followed by a letter.
|
|
93
|
+
['^\\w'],
|
|
94
|
+
// Side effect imports.
|
|
95
|
+
['^\\u0000'],
|
|
96
|
+
// Other relative imports. Put same-folder imports and `.` last.
|
|
97
|
+
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
|
|
98
|
+
// Parent imports. Put `..` last.
|
|
99
|
+
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
|
|
100
|
+
// Style imports.
|
|
101
|
+
['^.+\\.?(css|scss)$']
|
|
102
|
+
];
|
|
103
|
+
var rules$5 = {
|
|
104
|
+
'unused-imports/no-unused-imports': 'warn',
|
|
105
|
+
indent: 'off',
|
|
106
|
+
'brace-style': 'off',
|
|
107
|
+
'@stylistic/brace-style': ['warn', '1tbs'],
|
|
108
|
+
'@stylistic/indent': ['warn', 2],
|
|
109
|
+
'@stylistic/quote-props': ['warn', 'as-needed'],
|
|
110
|
+
quotes: 'off',
|
|
111
|
+
'@stylistic/quotes': ['warn', 'single'],
|
|
112
|
+
'@stylistic/semi': ['warn', 'never'],
|
|
113
|
+
'quote-props': 'off',
|
|
114
|
+
'comma-dangle': 'off',
|
|
115
|
+
'@stylistic/comma-dangle': ['warn', 'never'],
|
|
116
|
+
'@stylistic/object-curly-spacing': ['warn', 'always'],
|
|
117
|
+
'@stylistic/padded-blocks': ['warn', 'never'],
|
|
118
|
+
'@stylistic/arrow-parens': ['warn', 'as-needed'],
|
|
119
|
+
'@stylistic/dot-location': ['warn', 'property'],
|
|
120
|
+
'@stylistic/function-call-argument-newline': ['warn', 'never'],
|
|
121
|
+
'@stylistic/object-property-newline': [
|
|
122
|
+
'warn',
|
|
123
|
+
{ allowAllPropertiesOnSameLine: true }
|
|
124
|
+
],
|
|
125
|
+
'@stylistic/multiline-ternary': ['warn', 'always-multiline'],
|
|
126
|
+
'@stylistic/member-delimiter-style': ['error', {
|
|
127
|
+
multiline: {
|
|
128
|
+
delimiter: 'none',
|
|
129
|
+
requireLast: false
|
|
130
|
+
},
|
|
131
|
+
singleline: {
|
|
132
|
+
delimiter: 'comma',
|
|
133
|
+
requireLast: false
|
|
134
|
+
},
|
|
135
|
+
overrides: {
|
|
136
|
+
interface: {
|
|
137
|
+
multiline: {
|
|
138
|
+
delimiter: 'none',
|
|
139
|
+
requireLast: false
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}],
|
|
144
|
+
'@stylistic/no-extra-parens': 'off',
|
|
145
|
+
'@stylistic/max-len': [
|
|
146
|
+
'warn',
|
|
147
|
+
{
|
|
148
|
+
code: 120,
|
|
149
|
+
tabWidth: 2,
|
|
150
|
+
comments: 200,
|
|
151
|
+
ignoreStrings: true
|
|
152
|
+
}
|
|
153
|
+
],
|
|
154
|
+
'@stylistic/max-statements-per-line': ['warn', { max: 1 }],
|
|
155
|
+
'@stylistic/array-element-newline': ['warn', 'consistent'],
|
|
156
|
+
'@stylistic/no-extra-semi': 'off',
|
|
157
|
+
'@stylistic/no-multi-spaces': 'off',
|
|
158
|
+
'@stylistic/padding-line-between-statements': [
|
|
159
|
+
'warn',
|
|
160
|
+
{ blankLine: 'always', prev: '*', next: '*' },
|
|
161
|
+
{ blankLine: 'any', prev: 'import', next: 'import' },
|
|
162
|
+
{
|
|
163
|
+
blankLine: 'always',
|
|
164
|
+
prev: ['const', 'let', 'var'],
|
|
165
|
+
next: ['const', 'let', 'var']
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
blankLine: 'never',
|
|
169
|
+
prev: ['singleline-const', 'singleline-let', 'singleline-var'],
|
|
170
|
+
next: ['singleline-const', 'singleline-let', 'singleline-var']
|
|
171
|
+
},
|
|
172
|
+
{ blankLine: 'always', prev: 'block-like', next: 'const' },
|
|
173
|
+
{ blankLine: 'always', prev: 'const', next: 'block-like' }
|
|
174
|
+
],
|
|
175
|
+
'@stylistic/function-paren-newline': ['warn', 'consistent'],
|
|
176
|
+
'arrow-body-style': ['warn', 'as-needed'],
|
|
177
|
+
'prefer-arrow-callback': ['warn', { allowNamedFunctions: true }],
|
|
178
|
+
'func-style': ['warn', 'expression', { allowArrowFunctions: true }],
|
|
179
|
+
'simple-import-sort/imports': [
|
|
180
|
+
'warn',
|
|
181
|
+
{
|
|
182
|
+
groups: groups
|
|
183
|
+
}
|
|
184
|
+
],
|
|
185
|
+
'jsx-a11y/alt-text': 'warn',
|
|
186
|
+
'no-empty': 'warn',
|
|
187
|
+
'no-nested-ternary': 'warn',
|
|
188
|
+
'no-undef': 'warn',
|
|
189
|
+
'unused-imports/no-unused-vars': [
|
|
190
|
+
'warn',
|
|
191
|
+
{
|
|
192
|
+
vars: 'all',
|
|
193
|
+
varsIgnorePattern: '^_',
|
|
194
|
+
args: 'after-used',
|
|
195
|
+
argsIgnorePattern: '^_',
|
|
196
|
+
destructuredArrayIgnorePattern: '^_',
|
|
197
|
+
ignoreRestSiblings: true
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
'no-void': 'warn',
|
|
201
|
+
camelcase: 'warn',
|
|
202
|
+
'array-callback-return': 'warn',
|
|
203
|
+
'no-fallthrough': 'warn',
|
|
204
|
+
eqeqeq: 'warn',
|
|
205
|
+
'no-constant-binary-expression': 'warn',
|
|
206
|
+
'@stylistic/lines-around-comment': 'warn',
|
|
207
|
+
'import/no-duplicates': 'warn',
|
|
208
|
+
'valid-typeof': 'warn',
|
|
209
|
+
'no-constant-condition': 'warn',
|
|
210
|
+
'no-use-before-define': 'warn',
|
|
211
|
+
'@stylistic/implicit-arrow-linebreak': 'warn',
|
|
212
|
+
'import/export': 'warn',
|
|
213
|
+
'no-useless-escape': 'warn',
|
|
214
|
+
'no-useless-return': 'warn',
|
|
215
|
+
'prefer-promise-reject-errors': 'warn',
|
|
216
|
+
'no-useless-constructor': 'warn',
|
|
217
|
+
'no-new': 'warn',
|
|
218
|
+
'prefer-regex-literals': 'warn',
|
|
219
|
+
'@stylistic/multiline-comment-style': 'off',
|
|
220
|
+
'space-before-function-paren': 'off'
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
var rules$4 = {
|
|
224
|
+
'simple-import-sort/imports': [
|
|
225
|
+
'warn',
|
|
226
|
+
{
|
|
227
|
+
groups: __spreadArray([
|
|
228
|
+
// Packages `react` related packages come first.
|
|
229
|
+
['^react'],
|
|
230
|
+
['^(astro)(/.*|$)?']
|
|
231
|
+
], groups, true)
|
|
232
|
+
}
|
|
233
|
+
]
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
var astroConfig = __spreadArray(__spreadArray([], fixupConfigRules(flatCompat.config({
|
|
237
|
+
overrides: [{
|
|
238
|
+
files: ['*.astro'],
|
|
239
|
+
parser: 'astro-eslint-parser'
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
files: ['*.md', '*.mdx'],
|
|
243
|
+
extends: ['plugin:mdx/recommended'],
|
|
244
|
+
settings: {
|
|
245
|
+
'mdx/code-blocks': true,
|
|
246
|
+
'mdx/language-mapper': {}
|
|
247
|
+
},
|
|
248
|
+
rules: {
|
|
249
|
+
'max-len': 'off',
|
|
250
|
+
'react/react-in-jsx-scope': 'off'
|
|
251
|
+
}
|
|
252
|
+
}]
|
|
253
|
+
})), true), [
|
|
254
|
+
{
|
|
255
|
+
name: 'custom-astro',
|
|
256
|
+
rules: rules$4
|
|
257
|
+
}
|
|
258
|
+
], false);
|
|
259
|
+
|
|
260
|
+
var languageOptions$1 = {
|
|
261
|
+
ecmaVersion: 'latest',
|
|
262
|
+
sourceType: 'module',
|
|
263
|
+
globals: __assign(__assign({}, globals.browser), globals.node)
|
|
264
|
+
};
|
|
265
|
+
var jsConfig = [
|
|
266
|
+
__assign({ name: 'eslint-config' }, eslint.configs.recommended),
|
|
267
|
+
{
|
|
268
|
+
name: 'plugins',
|
|
269
|
+
plugins: {
|
|
270
|
+
n: pluginN,
|
|
271
|
+
promise: pluginPromise,
|
|
272
|
+
import: { rules: pluginImport.rules },
|
|
273
|
+
'simple-import-sort': pluginSimpleImport,
|
|
274
|
+
'jsx-a11y': pluginJsxA11y,
|
|
275
|
+
'unused-imports': pluginUnusedImport,
|
|
276
|
+
sonarjs: pluginSonarJs
|
|
277
|
+
},
|
|
278
|
+
languageOptions: languageOptions$1,
|
|
279
|
+
rules: __assign(__assign(__assign({}, configStandard.rules), pluginSonarJs.configs.recommended.rules), { 'import/first': 'off' })
|
|
280
|
+
},
|
|
281
|
+
__assign({ name: 'stylistic' }, pluginStylistic.configs['recommended-flat']),
|
|
282
|
+
{
|
|
283
|
+
name: 'custom-js',
|
|
284
|
+
languageOptions: languageOptions$1,
|
|
285
|
+
files: ['**/*.{js,jsx,mjs,cjs}'],
|
|
286
|
+
ignores: ['node_modules/*'],
|
|
287
|
+
rules: rules$5
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
name: 'ignore-node-modules-js',
|
|
291
|
+
ignores: ['node_modules/*']
|
|
292
|
+
}
|
|
293
|
+
];
|
|
294
|
+
|
|
295
|
+
var rules$3 = {
|
|
296
|
+
'simple-import-sort/imports': [
|
|
297
|
+
'warn',
|
|
298
|
+
{
|
|
299
|
+
groups: __spreadArray([
|
|
300
|
+
// Packages `react` related packages come first.
|
|
301
|
+
['^react'],
|
|
302
|
+
['^(next)(/.*|$)?']
|
|
303
|
+
], groups, true)
|
|
304
|
+
}
|
|
305
|
+
]
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
var nextConfig = __spreadArray(__spreadArray([], fixupConfigRules(flatCompat.extends('plugin:@next/next/core-web-vitals')), true), [
|
|
309
|
+
{
|
|
310
|
+
name: 'custom-next',
|
|
311
|
+
rules: rules$3
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
name: 'ignore-next-folder',
|
|
315
|
+
ignores: ['.next/*']
|
|
316
|
+
}
|
|
317
|
+
], false);
|
|
318
|
+
|
|
319
|
+
var rules$2 = {
|
|
320
|
+
'react/react-in-jsx-scope': 'off',
|
|
321
|
+
'react/jsx-max-depth': ['warn', { max: 7 }],
|
|
322
|
+
'react/prop-types': 'off',
|
|
323
|
+
'react-hooks/exhaustive-deps': 'off',
|
|
324
|
+
'react/button-has-type': 'warn',
|
|
325
|
+
'react/display-name': 'warn',
|
|
326
|
+
'react/no-children-prop': 'warn',
|
|
327
|
+
'react/no-danger-with-children': 'warn',
|
|
328
|
+
'react/no-unstable-nested-components': 'warn',
|
|
329
|
+
'react/self-closing-comp': ['warn', { component: true, html: true }],
|
|
330
|
+
'react/jsx-curly-brace-presence': [
|
|
331
|
+
'warn',
|
|
332
|
+
{ props: 'never', children: 'never' }
|
|
333
|
+
],
|
|
334
|
+
'react/jsx-curly-newline': 'warn',
|
|
335
|
+
'react/destructuring-assignment': 'warn',
|
|
336
|
+
'react/jsx-pascal-case': 'warn',
|
|
337
|
+
'react/boolean-prop-naming': 'warn',
|
|
338
|
+
'react/hook-use-state': 'warn',
|
|
339
|
+
'react/jsx-boolean-value': 'warn',
|
|
340
|
+
'react/jsx-closing-tag-location': 'warn',
|
|
341
|
+
'react/jsx-closing-bracket-location': 'warn',
|
|
342
|
+
'react/jsx-wrap-multilines': 'warn',
|
|
343
|
+
'react/jsx-no-target-blank': 'warn',
|
|
344
|
+
'react/jsx-no-leaked-render': 'warn',
|
|
345
|
+
'react/jsx-handler-names': 'warn',
|
|
346
|
+
'react/jsx-fragments': 'warn',
|
|
347
|
+
'react/no-deprecated': 'warn',
|
|
348
|
+
'react/no-multi-comp': 'warn',
|
|
349
|
+
'react/no-unescaped-entities': 'warn',
|
|
350
|
+
'react/jsx-no-undef': 'warn',
|
|
351
|
+
'react/no-unknown-property': 'warn',
|
|
352
|
+
'simple-import-sort/imports': [
|
|
353
|
+
'warn',
|
|
354
|
+
{
|
|
355
|
+
groups: __spreadArray([
|
|
356
|
+
// Packages `react` related packages come first.
|
|
357
|
+
['^react']
|
|
358
|
+
], groups, true)
|
|
359
|
+
}
|
|
360
|
+
]
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
var languageOptions = __assign(__assign({ ecmaVersion: 'latest', sourceType: 'module' }, pluginReactConfig.languageOptions), { globals: __assign(__assign({}, globals.browser), globals.node) });
|
|
364
|
+
var reactConfig = __spreadArray(__spreadArray([], fixupConfigRules(pluginReactConfig).map(function (react) { return (__assign(__assign({}, react), { name: 'react', languageOptions: languageOptions, settings: {
|
|
365
|
+
react: {
|
|
366
|
+
version: 'detect'
|
|
367
|
+
}
|
|
368
|
+
} })); }), true), [
|
|
369
|
+
{
|
|
370
|
+
name: 'custom-react',
|
|
371
|
+
plugins: {
|
|
372
|
+
'react-hooks': pluginReactHooks
|
|
373
|
+
},
|
|
374
|
+
languageOptions: languageOptions,
|
|
375
|
+
files: ['**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}'],
|
|
376
|
+
rules: __assign(__assign({}, pluginReactHooks.configs.recommended.rules), rules$2)
|
|
377
|
+
}
|
|
378
|
+
], false);
|
|
379
|
+
|
|
380
|
+
var rules$1 = __assign(__assign({}, rules$5), { semi: 'off', 'no-unused-vars': 'off', '@typescript-eslint/indent': 'off', '@typescript-eslint/no-unused-vars': [
|
|
381
|
+
'warn',
|
|
382
|
+
{
|
|
383
|
+
vars: 'all',
|
|
384
|
+
varsIgnorePattern: '^_',
|
|
385
|
+
args: 'after-used',
|
|
386
|
+
argsIgnorePattern: '^_',
|
|
387
|
+
destructuredArrayIgnorePattern: '^_',
|
|
388
|
+
ignoreRestSiblings: true
|
|
389
|
+
}
|
|
390
|
+
], '@typescript-eslint/no-explicit-any': 'warn', '@typescript-eslint/no-empty-function': 'warn', '@typescript-eslint/ban-types': 'warn', '@typescript-eslint/no-var-requires': 'warn', '@typescript-eslint/ban-ts-comment': 'warn', '@typescript-eslint/no-non-null-assertion': 'warn', '@typescript-eslint/no-invalid-void-type': 'warn', '@typescript-eslint/no-dynamic-delete': 'warn', '@typescript-eslint/no-useless-constructor': 'warn', '@typescript-eslint/prefer-for-of': 'warn', '@typescript-eslint/no-duplicate-enum-values': 'warn' });
|
|
391
|
+
|
|
392
|
+
var tsConfig = __spreadArray(__spreadArray([], tsEslint.configs.stylistic, true), [
|
|
393
|
+
{
|
|
394
|
+
name: 'custom-ts',
|
|
395
|
+
files: ['**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}'],
|
|
396
|
+
rules: rules$1
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
name: 'ignore-node-modules-ts',
|
|
400
|
+
ignores: ['node_modules/*']
|
|
401
|
+
}
|
|
402
|
+
], false);
|
|
403
|
+
|
|
404
|
+
var rules = {
|
|
405
|
+
'simple-import-sort/imports': [
|
|
406
|
+
'warn',
|
|
407
|
+
{
|
|
408
|
+
groups: __spreadArray([
|
|
409
|
+
// Packages `react` related packages come first.
|
|
410
|
+
['^react'],
|
|
411
|
+
['^(expo)(/.*|$)?']
|
|
412
|
+
], groups, true)
|
|
413
|
+
}
|
|
414
|
+
]
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
var expoConfig = __spreadArray(__spreadArray([], fixupConfigRules(flatCompat.extends('expo')), true), [
|
|
418
|
+
{
|
|
419
|
+
name: 'custom-expo',
|
|
420
|
+
rules: rules
|
|
421
|
+
}
|
|
422
|
+
], false);
|
|
423
|
+
|
|
424
|
+
var cspell = [
|
|
425
|
+
{
|
|
426
|
+
name: 'cspell',
|
|
427
|
+
plugins: { '@cspell': pluginCspell }
|
|
428
|
+
}
|
|
429
|
+
];
|
|
430
|
+
|
|
431
|
+
var i18next = __spreadArray([], fixupConfigRules(flatCompat.plugins('i18next')), true);
|
|
432
|
+
|
|
433
|
+
var tailwind = __spreadArray([], pluginTailwind.configs['flat/recommended'], true);
|
|
434
|
+
|
|
435
|
+
var vitest = __spreadArray(__spreadArray([], fixupConfigRules(flatCompat.extends('plugin:testing-library/react')), true), [
|
|
436
|
+
pluginVitest.configs.recommended
|
|
437
|
+
], false);
|
|
438
|
+
|
|
439
|
+
var ConfigOptions;
|
|
440
|
+
(function (ConfigOptions) {
|
|
441
|
+
ConfigOptions["Ts"] = "ts";
|
|
442
|
+
ConfigOptions["React"] = "react";
|
|
443
|
+
ConfigOptions["Next"] = "next";
|
|
444
|
+
ConfigOptions["Expo"] = "expo";
|
|
445
|
+
ConfigOptions["Astro"] = "astro";
|
|
446
|
+
})(ConfigOptions || (ConfigOptions = {}));
|
|
447
|
+
var OptionalOptions;
|
|
448
|
+
(function (OptionalOptions) {
|
|
449
|
+
OptionalOptions["Cspell"] = "cspell";
|
|
450
|
+
OptionalOptions["Tailwind"] = "tailwind";
|
|
451
|
+
OptionalOptions["Vitest"] = "vitest";
|
|
452
|
+
OptionalOptions["I18next"] = "i18next";
|
|
453
|
+
})(OptionalOptions || (OptionalOptions = {}));
|
|
454
|
+
var ReactConfigs = [
|
|
455
|
+
ConfigOptions.React,
|
|
456
|
+
ConfigOptions.Next,
|
|
457
|
+
ConfigOptions.Expo
|
|
458
|
+
];
|
|
459
|
+
// !important: The array order is important, the lower the more important
|
|
460
|
+
var eslintConfig = function (_a) {
|
|
461
|
+
var _b = _a === void 0 ? {} : _a, config = _b.config, optionals = _b.optionals;
|
|
462
|
+
var hasReact = ReactConfigs.some(function (reactConfig) { return config === null || config === void 0 ? void 0 : config.includes(reactConfig); });
|
|
463
|
+
return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], jsConfig, true), (hasReact ? reactConfig : []), true), ((config === null || config === void 0 ? void 0 : config.includes(ConfigOptions.Ts)) ? tsConfig : []), true), ((config === null || config === void 0 ? void 0 : config.includes(ConfigOptions.Next)) ? nextConfig : []), true), ((config === null || config === void 0 ? void 0 : config.includes(ConfigOptions.Astro)) ? astroConfig : []), true), ((config === null || config === void 0 ? void 0 : config.includes(ConfigOptions.Expo)) ? expoConfig : []), true), ((optionals === null || optionals === void 0 ? void 0 : optionals.includes(OptionalOptions.Cspell)) ? cspell : []), true), ((optionals === null || optionals === void 0 ? void 0 : optionals.includes(OptionalOptions.Tailwind)) ? tailwind : []), true), ((optionals === null || optionals === void 0 ? void 0 : optionals.includes(OptionalOptions.Vitest)) ? vitest : []), true), ((optionals === null || optionals === void 0 ? void 0 : optionals.includes(OptionalOptions.I18next)) ? i18next : []), true);
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
export { ConfigOptions, OptionalOptions, eslintConfig };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const cspell: {
|
|
2
|
+
name: string;
|
|
3
|
+
plugins: {
|
|
4
|
+
'@cspell': {
|
|
5
|
+
rules: {
|
|
6
|
+
spellchecker: import("eslint").Rule.RuleModule;
|
|
7
|
+
};
|
|
8
|
+
configs: Record<string, import("eslint").ESLint.ConfigData<import("eslint").Linter.RulesRecord> | import("eslint").Linter.FlatConfig<import("eslint").Linter.RulesRecord> | import("eslint").Linter.FlatConfig<import("eslint").Linter.RulesRecord>[]>;
|
|
9
|
+
meta: {
|
|
10
|
+
readonly name: "@cspell";
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
}[];
|
|
15
|
+
export { cspell };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
name?: string;
|
|
3
|
+
files?: Array<string | string[]>;
|
|
4
|
+
ignores?: string[];
|
|
5
|
+
languageOptions?: {
|
|
6
|
+
ecmaVersion?: import("eslint").Linter.ParserOptions["ecmaVersion"];
|
|
7
|
+
sourceType?: "script" | "module" | "commonjs";
|
|
8
|
+
globals?: import("eslint").ESLint.Environment["globals"];
|
|
9
|
+
parser?: import("eslint").Linter.FlatConfigParserModule;
|
|
10
|
+
parserOptions?: import("eslint").ESLint.Environment["parserOptions"];
|
|
11
|
+
};
|
|
12
|
+
linterOptions?: {
|
|
13
|
+
noInlineConfig?: boolean;
|
|
14
|
+
reportUnusedDisableDirectives?: import("eslint").Linter.Severity | import("eslint").Linter.StringSeverity | boolean;
|
|
15
|
+
};
|
|
16
|
+
processor?: string | import("eslint").Linter.Processor;
|
|
17
|
+
plugins?: Record<string, import("eslint").ESLint.Plugin>;
|
|
18
|
+
rules?: Partial<import("eslint").Linter.RulesRecord> | undefined;
|
|
19
|
+
settings?: Record<string, unknown>;
|
|
20
|
+
}[];
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const vitest: (import("eslint").Linter.FlatConfig<import("eslint").Linter.RulesRecord> | {
|
|
2
|
+
plugins: {
|
|
3
|
+
readonly vitest: import("eslint").ESLint.Plugin;
|
|
4
|
+
};
|
|
5
|
+
rules: {
|
|
6
|
+
readonly "vitest/expect-expect": "error";
|
|
7
|
+
readonly "vitest/no-identical-title": "error";
|
|
8
|
+
readonly "vitest/no-commented-out-tests": "error";
|
|
9
|
+
readonly "vitest/valid-title": "error";
|
|
10
|
+
readonly "vitest/valid-expect": "error";
|
|
11
|
+
readonly "vitest/valid-describe-callback": "error";
|
|
12
|
+
readonly "vitest/require-local-test-context-for-concurrent-snapshots": "error";
|
|
13
|
+
readonly "vitest/no-import-node-test": "error";
|
|
14
|
+
};
|
|
15
|
+
})[];
|
|
16
|
+
export { vitest };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@santi020k/eslint-config-santi020k",
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "A comprehensive ESLint configuration package for JavaScript, TypeScript, and React projects, including popular plugins and custom rules for consistent coding style.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"typings": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"/dist"
|
|
17
|
+
],
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/santi020k/eslint-config-santi020k.git"
|
|
21
|
+
},
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/santi020k/eslint-config-santi020k/issues"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/santi020k/eslint-config-santi020k#readme",
|
|
26
|
+
"keywords": [
|
|
27
|
+
"eslint",
|
|
28
|
+
"config",
|
|
29
|
+
"santi020k"
|
|
30
|
+
],
|
|
31
|
+
"author": "santi020k",
|
|
32
|
+
"contributors": [
|
|
33
|
+
"Santiago Molina <info@santi020k.me>"
|
|
34
|
+
],
|
|
35
|
+
"license": "Apache License 2.0",
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"eslint": "^9.0.0"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@eslint/config-inspector": "^0.5.0",
|
|
47
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
48
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
49
|
+
"@types/eslint__eslintrc": "^2.1.1",
|
|
50
|
+
"@types/node": "^20.14.8",
|
|
51
|
+
"@types/rollup-plugin-generate-package-json": "^3.2.9",
|
|
52
|
+
"cz-conventional-changelog": "^3.3.0",
|
|
53
|
+
"esbuild": "^0.21.5",
|
|
54
|
+
"husky": "^9.0.11",
|
|
55
|
+
"lint-staged": "^15.2.7",
|
|
56
|
+
"react": "^18.3.1",
|
|
57
|
+
"react-dom": "^18.3.1",
|
|
58
|
+
"rollup": "^4.18.0",
|
|
59
|
+
"rollup-plugin-generate-package-json": "^3.2.0",
|
|
60
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
61
|
+
"tslib": "^2.6.3",
|
|
62
|
+
"typescript": "^5.5.2",
|
|
63
|
+
"yalc": "^1.0.0-pre.53"
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"@cspell/eslint-plugin": "^8.9.1",
|
|
67
|
+
"@eslint/compat": "^1.1.0",
|
|
68
|
+
"@eslint/js": "^9.5.0",
|
|
69
|
+
"@stylistic/eslint-plugin": "^2.2.2",
|
|
70
|
+
"cross-dirname": "^0.1.0",
|
|
71
|
+
"eslint-config-standard": "^17.1.0",
|
|
72
|
+
"eslint-plugin-import": "^2.29.1",
|
|
73
|
+
"eslint-plugin-jsx-a11y": "^6.9.0",
|
|
74
|
+
"eslint-plugin-n": "^17.9.0",
|
|
75
|
+
"eslint-plugin-promise": "^6.2.0",
|
|
76
|
+
"eslint-plugin-react": "^7.34.3",
|
|
77
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
78
|
+
"eslint-plugin-simple-import-sort": "^12.1.0",
|
|
79
|
+
"eslint-plugin-sonarjs": "^1.0.3",
|
|
80
|
+
"eslint-plugin-tailwindcss": "^3.17.4",
|
|
81
|
+
"eslint-plugin-unused-imports": "^3.2.0",
|
|
82
|
+
"eslint-plugin-vitest": "^0.5.4",
|
|
83
|
+
"globals": "^15.6.0",
|
|
84
|
+
"typescript-eslint": "^7.13.1"
|
|
85
|
+
},
|
|
86
|
+
"overrides": {
|
|
87
|
+
"eslint-config-standard": "$eslint-config-standard",
|
|
88
|
+
"eslint-plugin-n": "$eslint-plugin-n",
|
|
89
|
+
"typescript-eslint": "$typescript-eslint",
|
|
90
|
+
"@typescript-eslint/eslint-plugin": "$@typescript-eslint/eslint-plugin",
|
|
91
|
+
"@typescript-eslint/type-utils": "$@typescript-eslint/type-utils",
|
|
92
|
+
"eslint": "$eslint"
|
|
93
|
+
},
|
|
94
|
+
"lint-staged": {
|
|
95
|
+
"*.{js, jsx, ts, tsx, md}": [
|
|
96
|
+
"npm run lint:fix"
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
"config": {
|
|
100
|
+
"commitizen": {
|
|
101
|
+
"path": "./node_modules/cz-conventional-changelog"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|