@dmitryrechkin/eslint-standard 1.4.9 → 1.5.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/eslint.config.mjs +22 -2
- package/package.json +1 -1
package/eslint.config.mjs
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
// eslint.config.mjs
|
|
2
|
+
//
|
|
3
|
+
// ESLint 9.x Flat Config for @dmitryrechkin/eslint-standard
|
|
4
|
+
//
|
|
5
|
+
// For optimal compatibility, pass the prettier plugin from your consuming project:
|
|
6
|
+
//
|
|
7
|
+
// import eslintConfig from "@dmitryrechkin/eslint-standard";
|
|
8
|
+
// import prettierPlugin from "eslint-plugin-prettier";
|
|
9
|
+
//
|
|
10
|
+
// export default eslintConfig({ prettierPlugin });
|
|
2
11
|
import tsParser from '@typescript-eslint/parser';
|
|
3
12
|
import tsPlugin from '@typescript-eslint/eslint-plugin';
|
|
4
13
|
import unusedImportsPlugin from 'eslint-plugin-unused-imports';
|
|
@@ -27,8 +36,12 @@ export default function ({
|
|
|
27
36
|
ignores = [],
|
|
28
37
|
files = [],
|
|
29
38
|
plugins = {},
|
|
30
|
-
rules = {}
|
|
39
|
+
rules = {},
|
|
40
|
+
prettierPlugin: externalPrettierPlugin = undefined
|
|
31
41
|
} = {}) {
|
|
42
|
+
// Use external prettier plugin if provided, otherwise fallback to bundled one
|
|
43
|
+
const activePrettierPlugin = externalPrettierPlugin || prettierPlugin;
|
|
44
|
+
|
|
32
45
|
return [
|
|
33
46
|
{
|
|
34
47
|
ignores: ['node_modules/**', 'dist/**', ...ignores],
|
|
@@ -64,7 +77,7 @@ export default function ({
|
|
|
64
77
|
'no-secrets': noSecretsPlugin,
|
|
65
78
|
'regexp': regexpPlugin,
|
|
66
79
|
'functional': functionalPlugin,
|
|
67
|
-
'prettier':
|
|
80
|
+
'prettier': activePrettierPlugin,
|
|
68
81
|
...plugins,
|
|
69
82
|
},
|
|
70
83
|
settings: {
|
|
@@ -574,6 +587,7 @@ export default function ({
|
|
|
574
587
|
'import/no-anonymous-default-export': 'warn',
|
|
575
588
|
'import/group-exports': 'off',
|
|
576
589
|
'import/dynamic-import-chunkname': 'off',
|
|
590
|
+
'import/order': 'off', // Disabled - conflicts with simple-import-sort plugin
|
|
577
591
|
|
|
578
592
|
// JSX A11y plugin rules (only active for React/JSX files)
|
|
579
593
|
'jsx-a11y/alt-text': 'error',
|
|
@@ -800,6 +814,9 @@ export default function ({
|
|
|
800
814
|
// Prettier config for TypeScript/JavaScript files with Allman brace style
|
|
801
815
|
{
|
|
802
816
|
files: ['**/*.{tsx,jsx,ts,js}'],
|
|
817
|
+
plugins: {
|
|
818
|
+
'prettier': activePrettierPlugin
|
|
819
|
+
},
|
|
803
820
|
rules: {
|
|
804
821
|
'prettier/prettier': [
|
|
805
822
|
'error',
|
|
@@ -819,6 +836,9 @@ export default function ({
|
|
|
819
836
|
// Prettier config for Astro files
|
|
820
837
|
{
|
|
821
838
|
files: ['**/*.astro'],
|
|
839
|
+
plugins: {
|
|
840
|
+
'prettier': activePrettierPlugin
|
|
841
|
+
},
|
|
822
842
|
rules: {
|
|
823
843
|
'prettier/prettier': [
|
|
824
844
|
'error',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dmitryrechkin/eslint-standard",
|
|
3
3
|
"description": "This package provides a shared ESLint configuration which includes TypeScript support and a set of specific linting rules designed to ensure high-quality and consistent code style across projects.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.5.1",
|
|
5
5
|
"main": "eslint.config.mjs",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./eslint.config.mjs"
|