@planfredapp/eslint-config 1.2.12 → 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 +23 -9
- package/package.json +19 -14
- 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,7 +11,7 @@ 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
|
|
|
@@ -30,6 +32,8 @@ npm install --save-dev eslint @planfredapp/eslint-config
|
|
|
30
32
|
| Cypress | `@planfredapp/eslint-config/cypress` | Base config, `typescript-eslint` recommended rules, Cypress globals, `.only()` protection |
|
|
31
33
|
| Test | `@planfredapp/eslint-config/test` | Base config, Vitest recommended rules, test globals, `.only()` protection |
|
|
32
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
|
+
|
|
33
37
|
### Vue-Specific Assumptions
|
|
34
38
|
|
|
35
39
|
The Vue config contains a few project-structure assumptions:
|
|
@@ -105,25 +109,28 @@ export default [
|
|
|
105
109
|
]
|
|
106
110
|
```
|
|
107
111
|
|
|
108
|
-
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:
|
|
109
113
|
|
|
110
114
|
```js
|
|
111
115
|
import baseConfig from '@planfredapp/eslint-config'
|
|
112
116
|
import cypressConfig from '@planfredapp/eslint-config/cypress'
|
|
113
117
|
import testConfig from '@planfredapp/eslint-config/test'
|
|
114
118
|
|
|
115
|
-
const
|
|
116
|
-
|
|
119
|
+
const withoutBase = config => config.slice(baseConfig.length)
|
|
120
|
+
const scope = (config, files) => config.map(entry => ({
|
|
121
|
+
...entry,
|
|
117
122
|
files,
|
|
118
123
|
}))
|
|
119
124
|
|
|
120
125
|
export default [
|
|
121
126
|
...baseConfig,
|
|
122
|
-
...scope(cypressConfig, [ 'cypress/**/*.{js,ts}' ]),
|
|
123
|
-
...scope(testConfig, [ 'test/**/*.{js,ts}' ]),
|
|
127
|
+
...scope(withoutBase(cypressConfig), [ 'cypress/**/*.{js,ts}' ]),
|
|
128
|
+
...scope(withoutBase(testConfig), [ 'test/**/*.{js,ts}' ]),
|
|
124
129
|
]
|
|
125
130
|
```
|
|
126
131
|
|
|
132
|
+
This avoids applying the base entries more than once. The specialized entrypoints intentionally begin with the same base config entries.
|
|
133
|
+
|
|
127
134
|
## What The Base Config Enforces
|
|
128
135
|
|
|
129
136
|
- 2-space indentation
|
|
@@ -133,15 +140,22 @@ export default [
|
|
|
133
140
|
- Blank lines between most statements
|
|
134
141
|
- Import ordering with grouped and alphabetized imports
|
|
135
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.
|
|
136
150
|
|
|
137
151
|
## Development
|
|
138
152
|
|
|
139
153
|
```bash
|
|
140
|
-
|
|
141
|
-
|
|
154
|
+
pnpm lint
|
|
155
|
+
pnpm vitest run test/<relevant-spec>.test.js
|
|
142
156
|
```
|
|
143
157
|
|
|
144
|
-
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).
|
|
145
159
|
|
|
146
160
|
## License
|
|
147
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,9 +29,14 @@
|
|
|
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
42
|
"node": ">=26"
|
|
@@ -39,20 +44,20 @@
|
|
|
39
44
|
"dependencies": {
|
|
40
45
|
"@eslint/js": "10.0.1",
|
|
41
46
|
"@stylistic/eslint-plugin": "5.10.0",
|
|
42
|
-
"@vitest/eslint-plugin": "1.6.
|
|
43
|
-
"eslint-plugin-cypress": "
|
|
44
|
-
"eslint-plugin-import-x": "4.
|
|
45
|
-
"eslint-plugin-n": "18.0
|
|
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",
|
|
46
51
|
"eslint-plugin-no-only-tests": "3.4.0",
|
|
47
|
-
"eslint-plugin-vue": "10.
|
|
48
|
-
"globals": "17.
|
|
49
|
-
"typescript-eslint": "8.
|
|
50
|
-
"vue-eslint-parser": "10.4.
|
|
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"
|
|
51
56
|
},
|
|
52
57
|
"devDependencies": {
|
|
53
|
-
"eslint": "10.
|
|
58
|
+
"eslint": "10.11.0",
|
|
54
59
|
"typescript": "6.0.3",
|
|
55
|
-
"vitest": "
|
|
60
|
+
"vitest": "5.0.1"
|
|
56
61
|
},
|
|
57
62
|
"peerDependencies": {
|
|
58
63
|
"eslint": ">=10.0.0"
|
package/eslint.config.js
DELETED