@dmitryrechkin/eslint-standard 1.4.9 → 1.5.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/eslint.config.mjs +21 -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: {
|
|
@@ -800,6 +813,9 @@ export default function ({
|
|
|
800
813
|
// Prettier config for TypeScript/JavaScript files with Allman brace style
|
|
801
814
|
{
|
|
802
815
|
files: ['**/*.{tsx,jsx,ts,js}'],
|
|
816
|
+
plugins: {
|
|
817
|
+
'prettier': activePrettierPlugin
|
|
818
|
+
},
|
|
803
819
|
rules: {
|
|
804
820
|
'prettier/prettier': [
|
|
805
821
|
'error',
|
|
@@ -819,6 +835,9 @@ export default function ({
|
|
|
819
835
|
// Prettier config for Astro files
|
|
820
836
|
{
|
|
821
837
|
files: ['**/*.astro'],
|
|
838
|
+
plugins: {
|
|
839
|
+
'prettier': activePrettierPlugin
|
|
840
|
+
},
|
|
822
841
|
rules: {
|
|
823
842
|
'prettier/prettier': [
|
|
824
843
|
'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.0",
|
|
5
5
|
"main": "eslint.config.mjs",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./eslint.config.mjs"
|