@st1ggy/linter-config 2.41.0 → 2.42.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
CHANGED
|
@@ -1 +1,37 @@
|
|
|
1
|
-
# linter-config
|
|
1
|
+
# @st1ggy/linter-config
|
|
2
|
+
|
|
3
|
+
Shared ESLint, Prettier and Stylelint configs for React, Next.js and Svelte projects.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i -D @st1ggy/linter-config
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Install only toolchain dependencies you actually use in your project (`eslint`, `prettier`, `stylelint`, framework packages).
|
|
12
|
+
|
|
13
|
+
## Tree-Shaking Friendly Imports
|
|
14
|
+
|
|
15
|
+
Prefer subpath imports to load only the required config:
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
import eslintReact from '@st1ggy/linter-config/eslint-react'
|
|
19
|
+
import prettierCommon from '@st1ggy/linter-config/prettier-common'
|
|
20
|
+
import stylelintScss from '@st1ggy/linter-config/stylelint-scss'
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Root import is supported, but it references all exported configs:
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
import { eslintReact } from '@st1ggy/linter-config'
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Available Configs
|
|
30
|
+
|
|
31
|
+
- `@st1ggy/linter-config/eslint-common`
|
|
32
|
+
- `@st1ggy/linter-config/eslint-react`
|
|
33
|
+
- `@st1ggy/linter-config/eslint-next`
|
|
34
|
+
- `@st1ggy/linter-config/eslint-svelte`
|
|
35
|
+
- `@st1ggy/linter-config/prettier-common`
|
|
36
|
+
- `@st1ggy/linter-config/prettier-svelte`
|
|
37
|
+
- `@st1ggy/linter-config/stylelint-scss`
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Linter } from 'eslint'
|
|
2
2
|
import { type Config as PrettierConfig } from 'prettier'
|
|
3
3
|
import { type Config as StylelintConfig } from 'stylelint'
|
|
4
4
|
|
|
5
|
+
type ConfigArray = Linter.Config[]
|
|
6
|
+
|
|
7
|
+
declare module '@st1ggy/linter-config' {
|
|
8
|
+
export const eslintCommon: ConfigArray
|
|
9
|
+
export const eslintReact: ConfigArray
|
|
10
|
+
export const eslintNext: ConfigArray
|
|
11
|
+
export const eslintSvelte: ConfigArray
|
|
12
|
+
|
|
13
|
+
export const prettierCommon: PrettierConfig
|
|
14
|
+
export const prettierSvelte: PrettierConfig
|
|
15
|
+
|
|
16
|
+
export const stylelintScss: StylelintConfig
|
|
17
|
+
}
|
|
18
|
+
|
|
5
19
|
declare module '@st1ggy/linter-config/eslint-next' {
|
|
6
20
|
const config: ConfigArray
|
|
7
21
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@st1ggy/linter-config",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.42.0",
|
|
4
4
|
"description": "ESLint, Stylelint and Prettier configs for React, Vue [WIP] and Svelte [WIP]",
|
|
5
5
|
"private": false,
|
|
6
6
|
"repository": {
|
|
@@ -19,48 +19,81 @@
|
|
|
19
19
|
},
|
|
20
20
|
"homepage": "https://github.com/St1ggy/linter-config#readme",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@eslint
|
|
23
|
-
"@eslint/
|
|
24
|
-
"@
|
|
22
|
+
"@next/eslint-plugin-next": "^16.1.6",
|
|
23
|
+
"@eslint/compat": "^2.0.2",
|
|
24
|
+
"@eslint/js": "^9.39.2",
|
|
25
|
+
"@stylistic/eslint-plugin": "^5.7.1",
|
|
25
26
|
"@stylistic/eslint-plugin-migrate": "^4.4.1",
|
|
26
|
-
"eslint": "^9.39.
|
|
27
|
-
"eslint-config-next": "^16.0.1",
|
|
27
|
+
"eslint": "^9.39.2",
|
|
28
28
|
"eslint-config-prettier": "^10.1.8",
|
|
29
29
|
"eslint-import-resolver-custom-alias": "^1.3.2",
|
|
30
30
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
31
31
|
"eslint-plugin-import": "^2.32.0",
|
|
32
|
-
"eslint-plugin-prettier": "^5.5.
|
|
32
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
33
33
|
"eslint-plugin-react": "^7.37.5",
|
|
34
34
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
35
|
-
"eslint-plugin-sonarjs": "^3.0.
|
|
36
|
-
"eslint-plugin-svelte": "^3.
|
|
35
|
+
"eslint-plugin-sonarjs": "^3.0.6",
|
|
36
|
+
"eslint-plugin-svelte": "^3.14.0",
|
|
37
37
|
"eslint-plugin-unicorn": "^62.0.0",
|
|
38
38
|
"find-up-simple": "^1.0.1",
|
|
39
39
|
"patch-package": "^8.0.1",
|
|
40
|
-
"prettier": "^3.
|
|
41
|
-
"prettier-plugin-svelte": "^3.4.
|
|
42
|
-
"stylelint": "^
|
|
43
|
-
"stylelint-config-clean-order": "^
|
|
44
|
-
"stylelint-config-
|
|
45
|
-
"stylelint-config-recommended": "^17.0.0",
|
|
46
|
-
"stylelint-config-
|
|
47
|
-
"stylelint-
|
|
48
|
-
"stylelint-
|
|
49
|
-
"stylelint-order": "^7.0.0",
|
|
40
|
+
"prettier": "^3.8.1",
|
|
41
|
+
"prettier-plugin-svelte": "^3.4.1",
|
|
42
|
+
"stylelint": "^17.1.1",
|
|
43
|
+
"stylelint-config-clean-order": "^8.0.0",
|
|
44
|
+
"stylelint-config-recommended": "^18.0.0",
|
|
45
|
+
"stylelint-config-recommended-scss": "^17.0.0",
|
|
46
|
+
"stylelint-config-sass-guidelines": "^13.0.0",
|
|
47
|
+
"stylelint-no-unsupported-browser-features": "^8.1.1",
|
|
48
|
+
"stylelint-order": "^7.0.1",
|
|
50
49
|
"stylelint-prettier": "^5.0.3",
|
|
51
50
|
"typescript": "^5.9.3",
|
|
52
|
-
"typescript-eslint": "^8.
|
|
51
|
+
"typescript-eslint": "^8.54.0"
|
|
53
52
|
},
|
|
53
|
+
"types": "./index.d.ts",
|
|
54
54
|
"type": "module",
|
|
55
|
+
"sideEffects": false,
|
|
55
56
|
"exports": {
|
|
56
|
-
".":
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"./
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
".": {
|
|
58
|
+
"types": "./index.d.ts",
|
|
59
|
+
"import": "./src/index.js",
|
|
60
|
+
"default": "./src/index.js"
|
|
61
|
+
},
|
|
62
|
+
"./eslint-next": {
|
|
63
|
+
"types": "./index.d.ts",
|
|
64
|
+
"import": "./src/eslint/eslint.config.next.js",
|
|
65
|
+
"default": "./src/eslint/eslint.config.next.js"
|
|
66
|
+
},
|
|
67
|
+
"./eslint-react": {
|
|
68
|
+
"types": "./index.d.ts",
|
|
69
|
+
"import": "./src/eslint/eslint.config.react.js",
|
|
70
|
+
"default": "./src/eslint/eslint.config.react.js"
|
|
71
|
+
},
|
|
72
|
+
"./eslint-svelte": {
|
|
73
|
+
"types": "./index.d.ts",
|
|
74
|
+
"import": "./src/eslint/eslint.config.svelte.js",
|
|
75
|
+
"default": "./src/eslint/eslint.config.svelte.js"
|
|
76
|
+
},
|
|
77
|
+
"./eslint-common": {
|
|
78
|
+
"types": "./index.d.ts",
|
|
79
|
+
"import": "./src/eslint/eslint.config.common.js",
|
|
80
|
+
"default": "./src/eslint/eslint.config.common.js"
|
|
81
|
+
},
|
|
82
|
+
"./prettier-common": {
|
|
83
|
+
"types": "./index.d.ts",
|
|
84
|
+
"import": "./src/prettier/prettier.config.common.js",
|
|
85
|
+
"default": "./src/prettier/prettier.config.common.js"
|
|
86
|
+
},
|
|
87
|
+
"./prettier-svelte": {
|
|
88
|
+
"types": "./index.d.ts",
|
|
89
|
+
"import": "./src/prettier/prettier.config.svelte.js",
|
|
90
|
+
"default": "./src/prettier/prettier.config.svelte.js"
|
|
91
|
+
},
|
|
92
|
+
"./stylelint-scss": {
|
|
93
|
+
"types": "./index.d.ts",
|
|
94
|
+
"import": "./src/stylelint/stylelint.config.scss.js",
|
|
95
|
+
"default": "./src/stylelint/stylelint.config.scss.js"
|
|
96
|
+
}
|
|
64
97
|
},
|
|
65
98
|
"files": [
|
|
66
99
|
"src",
|
|
@@ -72,7 +105,31 @@
|
|
|
72
105
|
"lint:fix": "eslint . --fix"
|
|
73
106
|
},
|
|
74
107
|
"peerDependencies": {
|
|
75
|
-
"
|
|
76
|
-
"
|
|
108
|
+
"eslint": "^9.0.0",
|
|
109
|
+
"next": "^16.0.0",
|
|
110
|
+
"prettier": "^3.0.0",
|
|
111
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
112
|
+
"stylelint": "^16.0.0",
|
|
113
|
+
"svelte": "^4.0.0 || ^5.0.0"
|
|
114
|
+
},
|
|
115
|
+
"peerDependenciesMeta": {
|
|
116
|
+
"eslint": {
|
|
117
|
+
"optional": true
|
|
118
|
+
},
|
|
119
|
+
"next": {
|
|
120
|
+
"optional": true
|
|
121
|
+
},
|
|
122
|
+
"prettier": {
|
|
123
|
+
"optional": true
|
|
124
|
+
},
|
|
125
|
+
"react": {
|
|
126
|
+
"optional": true
|
|
127
|
+
},
|
|
128
|
+
"stylelint": {
|
|
129
|
+
"optional": true
|
|
130
|
+
},
|
|
131
|
+
"svelte": {
|
|
132
|
+
"optional": true
|
|
133
|
+
}
|
|
77
134
|
}
|
|
78
135
|
}
|
|
@@ -6,4 +6,6 @@ import { fileURLToPath } from 'node:url'
|
|
|
6
6
|
|
|
7
7
|
const gitignorePath = findUpSync('.gitignore', { cwd: process.cwd() })
|
|
8
8
|
|
|
9
|
-
export default defineConfig(
|
|
9
|
+
export default defineConfig(
|
|
10
|
+
gitignorePath ? [includeIgnoreFile(fileURLToPath(new URL(gitignorePath, import.meta.url)))] : [],
|
|
11
|
+
)
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import stylistic from '@stylistic/eslint-plugin'
|
|
2
1
|
import { defineConfig } from 'eslint/config'
|
|
3
2
|
import reactPlugin from 'eslint-plugin-react'
|
|
4
3
|
import reactHooksPlugin from 'eslint-plugin-react-hooks'
|
|
@@ -8,7 +7,6 @@ import { files } from './constants.js'
|
|
|
8
7
|
export default defineConfig([
|
|
9
8
|
reactPlugin.configs.flat.recommended,
|
|
10
9
|
reactPlugin.configs.flat['jsx-runtime'],
|
|
11
|
-
stylistic.configs.recommended,
|
|
12
10
|
{
|
|
13
11
|
files,
|
|
14
12
|
plugins: { 'react-hooks': reactHooksPlugin },
|
package/src/examples/example.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const example = true
|