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