@santi020k/eslint-config-santi020k 2.0.0 → 2.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/dist/configs/astro/index.config.d.ts +13 -0
- package/dist/configs/astro/rules.d.ts +12 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +67 -31
- package/dist/index.mjs +67 -31
- package/dist/optionals/index.d.ts +2 -1
- package/dist/optionals/mdx.d.ts +2 -2
- package/dist/optionals/vitest.d.ts +7 -0
- package/dist/package.json +4 -1
- package/package.json +2 -1
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
declare const astroConfig: (import("eslint").Linter.FlatConfig<import("eslint").Linter.RulesRecord> | {
|
|
2
|
+
files: string[];
|
|
2
3
|
name: string;
|
|
3
4
|
rules: {
|
|
4
5
|
'simple-import-sort/imports': (string | {
|
|
5
6
|
groups: string[][];
|
|
6
7
|
})[];
|
|
8
|
+
'react/jsx-filename-extension': (number | {
|
|
9
|
+
extensions: string[];
|
|
10
|
+
})[];
|
|
11
|
+
'react/destructuring-assignment': string;
|
|
12
|
+
'react/require-default-props': string;
|
|
13
|
+
'react/jsx-props-no-spreading': string;
|
|
14
|
+
'react/react-in-jsx-scope': string;
|
|
15
|
+
'react/no-unknown-property': string;
|
|
16
|
+
'@stylistic/jsx-indent': string;
|
|
17
|
+
'@stylistic/jsx-one-expression-per-line': string;
|
|
18
|
+
'@stylistic/jsx-tag-spacing': string;
|
|
19
|
+
'react/jsx-key': string;
|
|
7
20
|
};
|
|
8
21
|
})[];
|
|
9
22
|
export { astroConfig };
|
|
@@ -2,5 +2,17 @@ declare const rules: {
|
|
|
2
2
|
'simple-import-sort/imports': (string | {
|
|
3
3
|
groups: string[][];
|
|
4
4
|
})[];
|
|
5
|
+
'react/jsx-filename-extension': (number | {
|
|
6
|
+
extensions: string[];
|
|
7
|
+
})[];
|
|
8
|
+
'react/destructuring-assignment': string;
|
|
9
|
+
'react/require-default-props': string;
|
|
10
|
+
'react/jsx-props-no-spreading': string;
|
|
11
|
+
'react/react-in-jsx-scope': string;
|
|
12
|
+
'react/no-unknown-property': string;
|
|
13
|
+
'@stylistic/jsx-indent': string;
|
|
14
|
+
'@stylistic/jsx-one-expression-per-line': string;
|
|
15
|
+
'@stylistic/jsx-tag-spacing': string;
|
|
16
|
+
'react/jsx-key': string;
|
|
5
17
|
};
|
|
6
18
|
export { rules };
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getDirname } from 'cross-dirname';
|
|
3
|
-
import { fixupConfigRules } from '@eslint/compat';
|
|
1
|
+
import pluginAstro from 'eslint-plugin-astro';
|
|
4
2
|
import eslint from '@eslint/js';
|
|
5
3
|
import pluginStylistic from '@stylistic/eslint-plugin';
|
|
6
4
|
import configStandard from 'eslint-config-standard';
|
|
@@ -12,10 +10,15 @@ import pluginSimpleImport from 'eslint-plugin-simple-import-sort';
|
|
|
12
10
|
import pluginSonarJs from 'eslint-plugin-sonarjs';
|
|
13
11
|
import pluginUnusedImport from 'eslint-plugin-unused-imports';
|
|
14
12
|
import globals from 'globals';
|
|
13
|
+
import { FlatCompat } from '@eslint/eslintrc';
|
|
14
|
+
import { getDirname } from 'cross-dirname';
|
|
15
|
+
import { fixupConfigRules } from '@eslint/compat';
|
|
15
16
|
import pluginReactConfig from 'eslint-plugin-react/configs/recommended.js';
|
|
16
17
|
import pluginReactHooks from 'eslint-plugin-react-hooks';
|
|
18
|
+
import tsParser from '@typescript-eslint/parser';
|
|
17
19
|
import tsEslint from 'typescript-eslint';
|
|
18
20
|
import pluginCspell from '@cspell/eslint-plugin';
|
|
21
|
+
import pluginMdx from 'eslint-plugin-mdx';
|
|
19
22
|
import pluginTailwind from 'eslint-plugin-tailwindcss';
|
|
20
23
|
import pluginVitest from 'eslint-plugin-vitest';
|
|
21
24
|
|
|
@@ -62,12 +65,6 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
62
65
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
63
66
|
};
|
|
64
67
|
|
|
65
|
-
// Initialize FlatCompat with the base directory and recommended configurations
|
|
66
|
-
var flatCompat = new FlatCompat({
|
|
67
|
-
baseDirectory: getDirname(),
|
|
68
|
-
recommendedConfig: {}
|
|
69
|
-
});
|
|
70
|
-
|
|
71
68
|
var groups = [
|
|
72
69
|
// Internal packages.
|
|
73
70
|
// Atomic Design and components
|
|
@@ -230,28 +227,24 @@ var rules$4 = {
|
|
|
230
227
|
['^(astro)(/.*|$)?']
|
|
231
228
|
], groups, true)
|
|
232
229
|
}
|
|
233
|
-
]
|
|
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'
|
|
234
243
|
};
|
|
235
244
|
|
|
236
|
-
var astroConfig = __spreadArray(__spreadArray([],
|
|
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), [
|
|
245
|
+
var astroConfig = __spreadArray(__spreadArray([], pluginAstro.configs.recommended, true), [
|
|
254
246
|
{
|
|
247
|
+
files: ['**/*.astro'],
|
|
255
248
|
name: 'custom-astro',
|
|
256
249
|
rules: rules$4
|
|
257
250
|
}
|
|
@@ -283,10 +276,21 @@ var jsConfig = [
|
|
|
283
276
|
name: 'custom-js',
|
|
284
277
|
languageOptions: languageOptions$1,
|
|
285
278
|
files: ['**/*.{js,jsx,mjs,cjs}'],
|
|
279
|
+
ignores: ['node_modules/*'],
|
|
286
280
|
rules: rules$5
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
name: 'ignore-node-modules-js',
|
|
284
|
+
ignores: ['node_modules/*']
|
|
287
285
|
}
|
|
288
286
|
];
|
|
289
287
|
|
|
288
|
+
// Initialize FlatCompat with the base directory and recommended configurations
|
|
289
|
+
var flatCompat = new FlatCompat({
|
|
290
|
+
baseDirectory: getDirname(),
|
|
291
|
+
recommendedConfig: {}
|
|
292
|
+
});
|
|
293
|
+
|
|
290
294
|
var rules$3 = {
|
|
291
295
|
'simple-import-sort/imports': [
|
|
292
296
|
'warn',
|
|
@@ -304,6 +308,10 @@ var nextConfig = __spreadArray(__spreadArray([], fixupConfigRules(flatCompat.ext
|
|
|
304
308
|
{
|
|
305
309
|
name: 'custom-next',
|
|
306
310
|
rules: rules$3
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
name: 'ignore-next-folder',
|
|
314
|
+
ignores: ['.next/*']
|
|
307
315
|
}
|
|
308
316
|
], false);
|
|
309
317
|
|
|
@@ -384,7 +392,17 @@ var tsConfig = __spreadArray(__spreadArray([], tsEslint.configs.stylistic, true)
|
|
|
384
392
|
{
|
|
385
393
|
name: 'custom-ts',
|
|
386
394
|
files: ['**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}'],
|
|
387
|
-
rules: rules$1
|
|
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/*']
|
|
388
406
|
}
|
|
389
407
|
], false);
|
|
390
408
|
|
|
@@ -417,10 +435,26 @@ var cspell = [
|
|
|
417
435
|
|
|
418
436
|
var i18next = __spreadArray([], fixupConfigRules(flatCompat.plugins('i18next')), true);
|
|
419
437
|
|
|
438
|
+
var mdx = [
|
|
439
|
+
__assign({}, pluginMdx.flat),
|
|
440
|
+
__assign(__assign({}, pluginMdx.flatCodeBlocks), { rules: __assign({}, pluginMdx.flatCodeBlocks.rules) })
|
|
441
|
+
];
|
|
442
|
+
|
|
420
443
|
var tailwind = __spreadArray([], pluginTailwind.configs['flat/recommended'], true);
|
|
421
444
|
|
|
422
445
|
var vitest = __spreadArray(__spreadArray([], fixupConfigRules(flatCompat.extends('plugin:testing-library/react')), true), [
|
|
423
|
-
pluginVitest.configs.recommended
|
|
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
|
+
}
|
|
424
458
|
], false);
|
|
425
459
|
|
|
426
460
|
var ConfigOptions;
|
|
@@ -437,9 +471,11 @@ var OptionalOptions;
|
|
|
437
471
|
OptionalOptions["Tailwind"] = "tailwind";
|
|
438
472
|
OptionalOptions["Vitest"] = "vitest";
|
|
439
473
|
OptionalOptions["I18next"] = "i18next";
|
|
474
|
+
OptionalOptions["Mdx"] = "mdx";
|
|
440
475
|
})(OptionalOptions || (OptionalOptions = {}));
|
|
441
476
|
var ReactConfigs = [
|
|
442
477
|
ConfigOptions.React,
|
|
478
|
+
ConfigOptions.Astro,
|
|
443
479
|
ConfigOptions.Next,
|
|
444
480
|
ConfigOptions.Expo
|
|
445
481
|
];
|
|
@@ -447,7 +483,7 @@ var ReactConfigs = [
|
|
|
447
483
|
var eslintConfig = function (_a) {
|
|
448
484
|
var _b = _a === void 0 ? {} : _a, config = _b.config, optionals = _b.optionals;
|
|
449
485
|
var hasReact = ReactConfigs.some(function (reactConfig) { return config === null || config === void 0 ? void 0 : config.includes(reactConfig); });
|
|
450
|
-
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);
|
|
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);
|
|
451
487
|
};
|
|
452
488
|
|
|
453
489
|
export { ConfigOptions, OptionalOptions, eslintConfig };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getDirname } from 'cross-dirname';
|
|
3
|
-
import { fixupConfigRules } from '@eslint/compat';
|
|
1
|
+
import pluginAstro from 'eslint-plugin-astro';
|
|
4
2
|
import eslint from '@eslint/js';
|
|
5
3
|
import pluginStylistic from '@stylistic/eslint-plugin';
|
|
6
4
|
import configStandard from 'eslint-config-standard';
|
|
@@ -12,10 +10,15 @@ import pluginSimpleImport from 'eslint-plugin-simple-import-sort';
|
|
|
12
10
|
import pluginSonarJs from 'eslint-plugin-sonarjs';
|
|
13
11
|
import pluginUnusedImport from 'eslint-plugin-unused-imports';
|
|
14
12
|
import globals from 'globals';
|
|
13
|
+
import { FlatCompat } from '@eslint/eslintrc';
|
|
14
|
+
import { getDirname } from 'cross-dirname';
|
|
15
|
+
import { fixupConfigRules } from '@eslint/compat';
|
|
15
16
|
import pluginReactConfig from 'eslint-plugin-react/configs/recommended.js';
|
|
16
17
|
import pluginReactHooks from 'eslint-plugin-react-hooks';
|
|
18
|
+
import tsParser from '@typescript-eslint/parser';
|
|
17
19
|
import tsEslint from 'typescript-eslint';
|
|
18
20
|
import pluginCspell from '@cspell/eslint-plugin';
|
|
21
|
+
import pluginMdx from 'eslint-plugin-mdx';
|
|
19
22
|
import pluginTailwind from 'eslint-plugin-tailwindcss';
|
|
20
23
|
import pluginVitest from 'eslint-plugin-vitest';
|
|
21
24
|
|
|
@@ -62,12 +65,6 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
62
65
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
63
66
|
};
|
|
64
67
|
|
|
65
|
-
// Initialize FlatCompat with the base directory and recommended configurations
|
|
66
|
-
var flatCompat = new FlatCompat({
|
|
67
|
-
baseDirectory: getDirname(),
|
|
68
|
-
recommendedConfig: {}
|
|
69
|
-
});
|
|
70
|
-
|
|
71
68
|
var groups = [
|
|
72
69
|
// Internal packages.
|
|
73
70
|
// Atomic Design and components
|
|
@@ -230,28 +227,24 @@ var rules$4 = {
|
|
|
230
227
|
['^(astro)(/.*|$)?']
|
|
231
228
|
], groups, true)
|
|
232
229
|
}
|
|
233
|
-
]
|
|
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'
|
|
234
243
|
};
|
|
235
244
|
|
|
236
|
-
var astroConfig = __spreadArray(__spreadArray([],
|
|
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), [
|
|
245
|
+
var astroConfig = __spreadArray(__spreadArray([], pluginAstro.configs.recommended, true), [
|
|
254
246
|
{
|
|
247
|
+
files: ['**/*.astro'],
|
|
255
248
|
name: 'custom-astro',
|
|
256
249
|
rules: rules$4
|
|
257
250
|
}
|
|
@@ -283,10 +276,21 @@ var jsConfig = [
|
|
|
283
276
|
name: 'custom-js',
|
|
284
277
|
languageOptions: languageOptions$1,
|
|
285
278
|
files: ['**/*.{js,jsx,mjs,cjs}'],
|
|
279
|
+
ignores: ['node_modules/*'],
|
|
286
280
|
rules: rules$5
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
name: 'ignore-node-modules-js',
|
|
284
|
+
ignores: ['node_modules/*']
|
|
287
285
|
}
|
|
288
286
|
];
|
|
289
287
|
|
|
288
|
+
// Initialize FlatCompat with the base directory and recommended configurations
|
|
289
|
+
var flatCompat = new FlatCompat({
|
|
290
|
+
baseDirectory: getDirname(),
|
|
291
|
+
recommendedConfig: {}
|
|
292
|
+
});
|
|
293
|
+
|
|
290
294
|
var rules$3 = {
|
|
291
295
|
'simple-import-sort/imports': [
|
|
292
296
|
'warn',
|
|
@@ -304,6 +308,10 @@ var nextConfig = __spreadArray(__spreadArray([], fixupConfigRules(flatCompat.ext
|
|
|
304
308
|
{
|
|
305
309
|
name: 'custom-next',
|
|
306
310
|
rules: rules$3
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
name: 'ignore-next-folder',
|
|
314
|
+
ignores: ['.next/*']
|
|
307
315
|
}
|
|
308
316
|
], false);
|
|
309
317
|
|
|
@@ -384,7 +392,17 @@ var tsConfig = __spreadArray(__spreadArray([], tsEslint.configs.stylistic, true)
|
|
|
384
392
|
{
|
|
385
393
|
name: 'custom-ts',
|
|
386
394
|
files: ['**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}'],
|
|
387
|
-
rules: rules$1
|
|
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/*']
|
|
388
406
|
}
|
|
389
407
|
], false);
|
|
390
408
|
|
|
@@ -417,10 +435,26 @@ var cspell = [
|
|
|
417
435
|
|
|
418
436
|
var i18next = __spreadArray([], fixupConfigRules(flatCompat.plugins('i18next')), true);
|
|
419
437
|
|
|
438
|
+
var mdx = [
|
|
439
|
+
__assign({}, pluginMdx.flat),
|
|
440
|
+
__assign(__assign({}, pluginMdx.flatCodeBlocks), { rules: __assign({}, pluginMdx.flatCodeBlocks.rules) })
|
|
441
|
+
];
|
|
442
|
+
|
|
420
443
|
var tailwind = __spreadArray([], pluginTailwind.configs['flat/recommended'], true);
|
|
421
444
|
|
|
422
445
|
var vitest = __spreadArray(__spreadArray([], fixupConfigRules(flatCompat.extends('plugin:testing-library/react')), true), [
|
|
423
|
-
pluginVitest.configs.recommended
|
|
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
|
+
}
|
|
424
458
|
], false);
|
|
425
459
|
|
|
426
460
|
var ConfigOptions;
|
|
@@ -437,9 +471,11 @@ var OptionalOptions;
|
|
|
437
471
|
OptionalOptions["Tailwind"] = "tailwind";
|
|
438
472
|
OptionalOptions["Vitest"] = "vitest";
|
|
439
473
|
OptionalOptions["I18next"] = "i18next";
|
|
474
|
+
OptionalOptions["Mdx"] = "mdx";
|
|
440
475
|
})(OptionalOptions || (OptionalOptions = {}));
|
|
441
476
|
var ReactConfigs = [
|
|
442
477
|
ConfigOptions.React,
|
|
478
|
+
ConfigOptions.Astro,
|
|
443
479
|
ConfigOptions.Next,
|
|
444
480
|
ConfigOptions.Expo
|
|
445
481
|
];
|
|
@@ -447,7 +483,7 @@ var ReactConfigs = [
|
|
|
447
483
|
var eslintConfig = function (_a) {
|
|
448
484
|
var _b = _a === void 0 ? {} : _a, config = _b.config, optionals = _b.optionals;
|
|
449
485
|
var hasReact = ReactConfigs.some(function (reactConfig) { return config === null || config === void 0 ? void 0 : config.includes(reactConfig); });
|
|
450
|
-
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);
|
|
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);
|
|
451
487
|
};
|
|
452
488
|
|
|
453
489
|
export { ConfigOptions, OptionalOptions, eslintConfig };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { cspell } from './cspell';
|
|
2
2
|
import { i18next } from './i18next';
|
|
3
|
+
import { mdx } from './mdx';
|
|
3
4
|
import { tailwind } from './tailwind';
|
|
4
5
|
import { vitest } from './vitest';
|
|
5
|
-
export { cspell, tailwind, vitest, i18next };
|
|
6
|
+
export { cspell, tailwind, vitest, i18next, mdx };
|
package/dist/optionals/mdx.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const mdx: {
|
|
2
2
|
name?: string;
|
|
3
3
|
files?: Array<string | string[]>;
|
|
4
4
|
ignores?: string[];
|
|
@@ -18,4 +18,4 @@ declare const _default: {
|
|
|
18
18
|
rules?: Partial<import("eslint").Linter.RulesRecord> | undefined;
|
|
19
19
|
settings?: Record<string, unknown>;
|
|
20
20
|
}[];
|
|
21
|
-
export
|
|
21
|
+
export { mdx };
|
|
@@ -12,5 +12,12 @@ declare const vitest: (import("eslint").Linter.FlatConfig<import("eslint").Linte
|
|
|
12
12
|
readonly "vitest/require-local-test-context-for-concurrent-snapshots": "error";
|
|
13
13
|
readonly "vitest/no-import-node-test": "error";
|
|
14
14
|
};
|
|
15
|
+
} | {
|
|
16
|
+
name: string;
|
|
17
|
+
rules: {
|
|
18
|
+
'vitest/expect-expect': (string | {
|
|
19
|
+
assertFunctionNames: string[];
|
|
20
|
+
})[];
|
|
21
|
+
};
|
|
15
22
|
})[];
|
|
16
23
|
export { vitest };
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@santi020k/eslint-config-santi020k",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "A comprehensive ESLint configuration package for JavaScript, TypeScript, and React projects, including popular plugins and custom rules for consistent coding style.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -67,10 +67,13 @@
|
|
|
67
67
|
"@eslint/compat": "^1.1.0",
|
|
68
68
|
"@eslint/js": "^9.5.0",
|
|
69
69
|
"@stylistic/eslint-plugin": "^2.2.2",
|
|
70
|
+
"@typescript-eslint/parser": "^7.13.1",
|
|
70
71
|
"cross-dirname": "^0.1.0",
|
|
71
72
|
"eslint-config-standard": "^17.1.0",
|
|
73
|
+
"eslint-plugin-astro": "^1.2.2",
|
|
72
74
|
"eslint-plugin-import": "^2.29.1",
|
|
73
75
|
"eslint-plugin-jsx-a11y": "^6.9.0",
|
|
76
|
+
"eslint-plugin-mdx": "^3.1.5",
|
|
74
77
|
"eslint-plugin-n": "^17.9.0",
|
|
75
78
|
"eslint-plugin-promise": "^6.2.0",
|
|
76
79
|
"eslint-plugin-react": "^7.34.3",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@santi020k/eslint-config-santi020k",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A comprehensive ESLint configuration package for JavaScript, TypeScript, and React projects, including popular plugins and custom rules for consistent coding style.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"@stylistic/eslint-plugin": "^2.2.2",
|
|
83
83
|
"@types/eslint__js": "^8.42.3",
|
|
84
84
|
"@typescript-eslint/eslint-plugin": "^7.13.1",
|
|
85
|
+
"@typescript-eslint/parser": "^7.13.1",
|
|
85
86
|
"@typescript-eslint/type-utils": "^7.13.1",
|
|
86
87
|
"cross-dirname": "^0.1.0",
|
|
87
88
|
"eslint-config-expo": "^7.1.2",
|