@planfredapp/eslint-config 1.2.1 → 1.2.15
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 +25 -9
- package/package.json +33 -31
- package/eslint.config.js +0 -12
- package/vitest.config.js +0 -8
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @planfredapp/eslint-config
|
|
2
2
|
|
|
3
|
+
[View package on npm](https://www.npmjs.com/package/@planfredapp/eslint-config)
|
|
4
|
+
|
|
3
5
|
[](https://www.npmjs.com/package/@planfredapp/eslint-config)
|
|
4
6
|
[](LICENSE)
|
|
5
7
|
|
|
@@ -9,13 +11,15 @@ The package ships its plugins and parsers as dependencies. In consuming projects
|
|
|
9
11
|
|
|
10
12
|
## Requirements
|
|
11
13
|
|
|
12
|
-
- Node
|
|
14
|
+
- Node `>=26`
|
|
13
15
|
- `eslint >= 10`
|
|
14
16
|
- An ESM flat config file such as `eslint.config.js` or `eslint.config.mjs`
|
|
15
17
|
|
|
16
18
|
## Installation
|
|
17
19
|
|
|
18
20
|
```bash
|
|
21
|
+
pnpm add -D eslint @planfredapp/eslint-config
|
|
22
|
+
# or
|
|
19
23
|
npm install --save-dev eslint @planfredapp/eslint-config
|
|
20
24
|
```
|
|
21
25
|
|
|
@@ -28,6 +32,8 @@ npm install --save-dev eslint @planfredapp/eslint-config
|
|
|
28
32
|
| Cypress | `@planfredapp/eslint-config/cypress` | Base config, `typescript-eslint` recommended rules, Cypress globals, `.only()` protection |
|
|
29
33
|
| Test | `@planfredapp/eslint-config/test` | Base config, Vitest recommended rules, test globals, `.only()` protection |
|
|
30
34
|
|
|
35
|
+
Every specialized entrypoint already includes the complete base config. Use the base entrypoint by itself for plain JavaScript, or select a specialized entrypoint when it applies to the whole project.
|
|
36
|
+
|
|
31
37
|
### Vue-Specific Assumptions
|
|
32
38
|
|
|
33
39
|
The Vue config contains a few project-structure assumptions:
|
|
@@ -103,25 +109,28 @@ export default [
|
|
|
103
109
|
]
|
|
104
110
|
```
|
|
105
111
|
|
|
106
|
-
If
|
|
112
|
+
If one root `eslint.config.js` combines multiple specialized configs, apply the base config once and scope only each specialized config's additional entries:
|
|
107
113
|
|
|
108
114
|
```js
|
|
109
115
|
import baseConfig from '@planfredapp/eslint-config'
|
|
110
116
|
import cypressConfig from '@planfredapp/eslint-config/cypress'
|
|
111
117
|
import testConfig from '@planfredapp/eslint-config/test'
|
|
112
118
|
|
|
113
|
-
const
|
|
114
|
-
|
|
119
|
+
const withoutBase = config => config.slice(baseConfig.length)
|
|
120
|
+
const scope = (config, files) => config.map(entry => ({
|
|
121
|
+
...entry,
|
|
115
122
|
files,
|
|
116
123
|
}))
|
|
117
124
|
|
|
118
125
|
export default [
|
|
119
126
|
...baseConfig,
|
|
120
|
-
...scope(cypressConfig, [ 'cypress/**/*.{js,ts}' ]),
|
|
121
|
-
...scope(testConfig, [ 'test/**/*.{js,ts}' ]),
|
|
127
|
+
...scope(withoutBase(cypressConfig), [ 'cypress/**/*.{js,ts}' ]),
|
|
128
|
+
...scope(withoutBase(testConfig), [ 'test/**/*.{js,ts}' ]),
|
|
122
129
|
]
|
|
123
130
|
```
|
|
124
131
|
|
|
132
|
+
This avoids applying the base entries more than once. The specialized entrypoints intentionally begin with the same base config entries.
|
|
133
|
+
|
|
125
134
|
## What The Base Config Enforces
|
|
126
135
|
|
|
127
136
|
- 2-space indentation
|
|
@@ -131,15 +140,22 @@ export default [
|
|
|
131
140
|
- Blank lines between most statements
|
|
132
141
|
- Import ordering with grouped and alphabetized imports
|
|
133
142
|
- `no-var`, `prefer-const`, and a broad set of core correctness rules
|
|
143
|
+
- Promise executor parameters named `resolve` and `reject`
|
|
144
|
+
|
|
145
|
+
The Vue config also enforces `@/` imports inside `src/` through the bundled `no-relative-import-paths` rule and provides an autofix for matching relative imports.
|
|
146
|
+
|
|
147
|
+
## Package Contents
|
|
148
|
+
|
|
149
|
+
The npm package contains the four public config entrypoints plus the two internal custom-rule modules they use. Repository-only ESLint and Vitest config files are excluded from the published tarball.
|
|
134
150
|
|
|
135
151
|
## Development
|
|
136
152
|
|
|
137
153
|
```bash
|
|
138
|
-
|
|
139
|
-
|
|
154
|
+
pnpm lint
|
|
155
|
+
pnpm vitest run test/<relevant-spec>.test.js
|
|
140
156
|
```
|
|
141
157
|
|
|
142
|
-
More details are in [TESTING.md](TESTING.md). Release history is in [CHANGELOG.md](CHANGELOG.md).
|
|
158
|
+
Run the complete test suite through GitHub Actions. More details are in [TESTING.md](TESTING.md). Release history is in [CHANGELOG.md](CHANGELOG.md).
|
|
143
159
|
|
|
144
160
|
## License
|
|
145
161
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planfredapp/eslint-config",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "Shared ESLint 10 configurations for Planfred
|
|
3
|
+
"version": "1.2.15",
|
|
4
|
+
"description": "Shared ESLint 10 flat configurations for Planfred projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
7
7
|
"eslint-config",
|
|
@@ -29,46 +29,48 @@
|
|
|
29
29
|
"./cypress": "./cypress.js",
|
|
30
30
|
"./test": "./test.js"
|
|
31
31
|
},
|
|
32
|
-
"main": "
|
|
32
|
+
"main": "./base.js",
|
|
33
33
|
"files": [
|
|
34
|
-
"
|
|
34
|
+
"base.js",
|
|
35
|
+
"cypress.js",
|
|
36
|
+
"no-relative-import-paths.js",
|
|
37
|
+
"promise-param-names.js",
|
|
38
|
+
"test.js",
|
|
39
|
+
"vue.js"
|
|
35
40
|
],
|
|
36
41
|
"engines": {
|
|
37
|
-
"node": "
|
|
38
|
-
},
|
|
39
|
-
"scripts": {
|
|
40
|
-
"lint": "eslint .",
|
|
41
|
-
"lint:fix": "eslint . --fix",
|
|
42
|
-
"release": "npm publish --access public",
|
|
43
|
-
"test": "vitest",
|
|
44
|
-
"test:run": "vitest run",
|
|
45
|
-
"upgrade": "./scripts/upgrade.sh",
|
|
46
|
-
"version:major": "./scripts/version.sh major",
|
|
47
|
-
"version:minor": "./scripts/version.sh minor",
|
|
48
|
-
"version:patch": "./scripts/version.sh patch"
|
|
42
|
+
"node": ">=26"
|
|
49
43
|
},
|
|
50
44
|
"dependencies": {
|
|
51
45
|
"@eslint/js": "10.0.1",
|
|
52
46
|
"@stylistic/eslint-plugin": "5.10.0",
|
|
53
|
-
"@vitest/eslint-plugin": "1.6.
|
|
54
|
-
"eslint-plugin-cypress": "
|
|
55
|
-
"eslint-plugin-import-x": "4.
|
|
56
|
-
"eslint-plugin-n": "
|
|
57
|
-
"eslint-plugin-no-only-tests": "3.
|
|
58
|
-
"eslint-plugin-vue": "10.
|
|
59
|
-
"globals": "17.
|
|
60
|
-
"typescript-eslint": "8.
|
|
61
|
-
"vue-eslint-parser": "10.4.
|
|
47
|
+
"@vitest/eslint-plugin": "1.6.27",
|
|
48
|
+
"eslint-plugin-cypress": "7.0.2",
|
|
49
|
+
"eslint-plugin-import-x": "4.17.1",
|
|
50
|
+
"eslint-plugin-n": "18.3.0",
|
|
51
|
+
"eslint-plugin-no-only-tests": "3.4.0",
|
|
52
|
+
"eslint-plugin-vue": "10.11.0",
|
|
53
|
+
"globals": "17.12.0",
|
|
54
|
+
"typescript-eslint": "8.70.0",
|
|
55
|
+
"vue-eslint-parser": "10.4.1"
|
|
62
56
|
},
|
|
63
57
|
"devDependencies": {
|
|
64
|
-
"eslint": "10.
|
|
65
|
-
"typescript": "6.0.
|
|
66
|
-
"vitest": "
|
|
58
|
+
"eslint": "10.11.0",
|
|
59
|
+
"typescript": "6.0.3",
|
|
60
|
+
"vitest": "5.0.1"
|
|
67
61
|
},
|
|
68
62
|
"peerDependencies": {
|
|
69
63
|
"eslint": ">=10.0.0"
|
|
70
64
|
},
|
|
71
|
-
"
|
|
72
|
-
"
|
|
65
|
+
"scripts": {
|
|
66
|
+
"lint": "eslint .",
|
|
67
|
+
"lint:fix": "eslint . --fix",
|
|
68
|
+
"release": "pnpm publish --access public --no-git-checks",
|
|
69
|
+
"test": "vitest",
|
|
70
|
+
"test:run": "vitest run",
|
|
71
|
+
"deps:upgrade": "./scripts/upgrade.sh",
|
|
72
|
+
"version:major": "./scripts/version.sh major",
|
|
73
|
+
"version:minor": "./scripts/version.sh minor",
|
|
74
|
+
"version:patch": "./scripts/version.sh patch"
|
|
73
75
|
}
|
|
74
|
-
}
|
|
76
|
+
}
|
package/eslint.config.js
DELETED