@planfredapp/eslint-config 1.0.51 → 1.0.53
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 +73 -89
- package/base.js +4 -4
- package/eslint.config.js +1 -1
- package/package.json +2 -2
- package/vue.js +5 -5
package/README.md
CHANGED
|
@@ -1,129 +1,113 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @planfredapp/eslint-config
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@planfredapp/eslint-config)
|
|
4
|
+
[](LICENSE)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
Shared ESLint configurations for the Planfred monorepo. Uses ESLint 9 flat config format.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
## Installation
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
- Import/export rules
|
|
13
|
-
- Node.js specific rules
|
|
14
|
-
- Promise handling rules
|
|
15
|
-
- Stylistic rules
|
|
16
|
-
|
|
17
|
-
### Vue Configuration
|
|
18
|
-
|
|
19
|
-
Extends the base configuration with Vue.js specific rules:
|
|
20
|
-
|
|
21
|
-
- Vue component rules
|
|
22
|
-
- Template-specific styling rules
|
|
23
|
-
- Component naming conventions
|
|
24
|
-
- Vue-specific import path rules
|
|
25
|
-
|
|
26
|
-
### Cypress Configuration
|
|
27
|
-
|
|
28
|
-
Extends the base configuration with Cypress testing rules:
|
|
29
|
-
|
|
30
|
-
- TypeScript support
|
|
31
|
-
- Cypress-specific globals and rules
|
|
32
|
-
- Test-specific linting rules
|
|
33
|
-
|
|
34
|
-
### Test Configuration
|
|
10
|
+
```bash
|
|
11
|
+
npm install --save-dev @planfredapp/eslint-config eslint
|
|
12
|
+
```
|
|
35
13
|
|
|
36
|
-
|
|
14
|
+
## Configurations
|
|
37
15
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
-
|
|
16
|
+
| Config | Import Path | Description |
|
|
17
|
+
|--------|-------------|-------------|
|
|
18
|
+
| Base | `@planfredapp/eslint-config/base` | Core JS rules, imports, Node.js, stylistic |
|
|
19
|
+
| Vue | `@planfredapp/eslint-config/vue` | Vue 3 components, extends base |
|
|
20
|
+
| Cypress | `@planfredapp/eslint-config/cypress` | E2E tests with TypeScript |
|
|
21
|
+
| Test | `@planfredapp/eslint-config/test` | Vitest unit tests |
|
|
41
22
|
|
|
42
23
|
## Usage
|
|
43
24
|
|
|
44
|
-
|
|
25
|
+
Create `eslint.config.js` in your project root:
|
|
45
26
|
|
|
46
27
|
```javascript
|
|
47
|
-
//
|
|
28
|
+
// Base config
|
|
48
29
|
import baseConfig from '@planfredapp/eslint-config/base'
|
|
30
|
+
export default [...baseConfig]
|
|
49
31
|
|
|
50
|
-
|
|
51
|
-
...baseConfig,
|
|
52
|
-
// your specific overrides
|
|
53
|
-
]
|
|
54
|
-
|
|
55
|
-
// For Vue projects
|
|
32
|
+
// Vue project
|
|
56
33
|
import vueConfig from '@planfredapp/eslint-config/vue'
|
|
34
|
+
export default [...vueConfig]
|
|
57
35
|
|
|
36
|
+
// With overrides
|
|
37
|
+
import vueConfig from '@planfredapp/eslint-config/vue'
|
|
58
38
|
export default [
|
|
59
39
|
...vueConfig,
|
|
60
|
-
|
|
40
|
+
{
|
|
41
|
+
rules: {
|
|
42
|
+
'no-console': 'warn',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
61
45
|
]
|
|
46
|
+
```
|
|
62
47
|
|
|
63
|
-
|
|
64
|
-
import cypressConfig from '@planfredapp/eslint-config/cypress'
|
|
48
|
+
## Included Plugins
|
|
65
49
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
50
|
+
### Base Config
|
|
51
|
+
- `@eslint/js` - ESLint recommended
|
|
52
|
+
- `@stylistic/eslint-plugin` - Code formatting
|
|
53
|
+
- `eslint-plugin-import` - Import/export validation
|
|
54
|
+
- `eslint-plugin-n` - Node.js rules
|
|
55
|
+
- `eslint-plugin-promise` - Promise handling
|
|
70
56
|
|
|
71
|
-
|
|
72
|
-
|
|
57
|
+
### Vue Config
|
|
58
|
+
- `eslint-plugin-vue` - Vue 3 rules
|
|
59
|
+
- `eslint-plugin-no-relative-import-paths` - Enforce `@/` imports
|
|
73
60
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
]
|
|
78
|
-
```
|
|
61
|
+
### Cypress Config
|
|
62
|
+
- `eslint-plugin-cypress` - Cypress globals and best practices
|
|
63
|
+
- `typescript-eslint` - TypeScript support
|
|
79
64
|
|
|
80
|
-
###
|
|
65
|
+
### Test Config
|
|
66
|
+
- `@vitest/eslint-plugin` - Vitest globals and rules
|
|
67
|
+
- `eslint-plugin-no-only-tests` - Prevent `.only()` in CI
|
|
81
68
|
|
|
82
|
-
|
|
69
|
+
## Key Rules
|
|
83
70
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
71
|
+
### Stylistic
|
|
72
|
+
- 2-space indentation
|
|
73
|
+
- Single quotes, no semicolons
|
|
74
|
+
- Trailing commas in multiline
|
|
75
|
+
- Spaces inside brackets: `[ 'a', 'b' ]`
|
|
76
|
+
- Newlines for arrays/objects with 2+ items
|
|
77
|
+
- Blank lines between statements
|
|
91
78
|
|
|
92
|
-
|
|
79
|
+
### Imports
|
|
80
|
+
- Alphabetized, grouped by type
|
|
81
|
+
- Newlines between groups
|
|
82
|
+
- No relative paths in Vue (use `@/`)
|
|
93
83
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
84
|
+
### Vue-Specific
|
|
85
|
+
- Template-first block order
|
|
86
|
+
- Component name matching filename
|
|
87
|
+
- No unused refs/props/emits
|
|
88
|
+
- PascalCase component names in templates
|
|
97
89
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
You can install specific versions:
|
|
90
|
+
## Peer Dependencies
|
|
101
91
|
|
|
102
92
|
```json
|
|
103
93
|
{
|
|
104
|
-
"
|
|
105
|
-
"@planfredapp/eslint-config": "1.0.12"
|
|
106
|
-
}
|
|
94
|
+
"eslint": "9.0.0"
|
|
107
95
|
}
|
|
108
96
|
```
|
|
109
97
|
|
|
110
|
-
|
|
98
|
+
## Files
|
|
111
99
|
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
100
|
+
```
|
|
101
|
+
base.js - Core configuration
|
|
102
|
+
vue.js - Vue.js (extends base)
|
|
103
|
+
cypress.js - Cypress E2E (extends base)
|
|
104
|
+
test.js - Vitest unit tests (extends base)
|
|
118
105
|
```
|
|
119
106
|
|
|
120
|
-
##
|
|
107
|
+
## Changelog
|
|
121
108
|
|
|
122
|
-
|
|
109
|
+
See [CHANGELOG.md](CHANGELOG.md) for version history.
|
|
123
110
|
|
|
124
|
-
|
|
125
|
-
- `vue.js` - Vue.js specific configuration extending base
|
|
126
|
-
- `cypress.js` - Cypress testing configuration extending base
|
|
127
|
-
- `test.js` - General testing configuration extending base
|
|
111
|
+
## License
|
|
128
112
|
|
|
129
|
-
|
|
113
|
+
[MIT](LICENSE)
|
package/base.js
CHANGED
|
@@ -49,7 +49,7 @@ export default [
|
|
|
49
49
|
camelcase: [
|
|
50
50
|
'error',
|
|
51
51
|
{
|
|
52
|
-
allow: ['^UNSAFE_'],
|
|
52
|
+
allow: [ '^UNSAFE_' ],
|
|
53
53
|
properties: 'never',
|
|
54
54
|
ignoreGlobals: true,
|
|
55
55
|
},
|
|
@@ -311,12 +311,12 @@ export default [
|
|
|
311
311
|
},
|
|
312
312
|
],
|
|
313
313
|
'stylistic/arrow-parens': 'off',
|
|
314
|
-
'stylistic/template-curly-spacing': ['off'],
|
|
314
|
+
'stylistic/template-curly-spacing': [ 'off' ],
|
|
315
315
|
|
|
316
316
|
// standard style rules
|
|
317
317
|
'stylistic/array-bracket-spacing': [
|
|
318
318
|
'error',
|
|
319
|
-
'
|
|
319
|
+
'always',
|
|
320
320
|
],
|
|
321
321
|
'stylistic/arrow-spacing': [
|
|
322
322
|
'error',
|
|
@@ -644,7 +644,7 @@ export default [
|
|
|
644
644
|
'::',
|
|
645
645
|
'flow-include',
|
|
646
646
|
],
|
|
647
|
-
exceptions: ['*'],
|
|
647
|
+
exceptions: [ '*' ],
|
|
648
648
|
},
|
|
649
649
|
},
|
|
650
650
|
],
|
package/eslint.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planfredapp/eslint-config",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.53",
|
|
4
4
|
"description": "Shared ESLint configurations for Planfred monorepo",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"vue-eslint-parser": "10.2.0"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"eslint": "9.0.0"
|
|
68
|
+
"eslint": ">=9.0.0"
|
|
69
69
|
},
|
|
70
70
|
"overrides": {
|
|
71
71
|
"js-yaml": "4.1.1"
|
package/vue.js
CHANGED
|
@@ -13,7 +13,7 @@ export default [
|
|
|
13
13
|
},
|
|
14
14
|
rules: {
|
|
15
15
|
// vue rules
|
|
16
|
-
'vue/padding-lines-in-component-definition': ['error'],
|
|
16
|
+
'vue/padding-lines-in-component-definition': [ 'error' ],
|
|
17
17
|
'vue/padding-line-between-blocks': 'error',
|
|
18
18
|
'vue/padding-line-between-tags': [
|
|
19
19
|
'error',
|
|
@@ -92,7 +92,7 @@ export default [
|
|
|
92
92
|
{ ArrayExpression: 'consistent' },
|
|
93
93
|
],
|
|
94
94
|
'vue/arrow-parens': 'off',
|
|
95
|
-
'vue/template-curly-spacing': ['off'],
|
|
95
|
+
'vue/template-curly-spacing': [ 'off' ],
|
|
96
96
|
|
|
97
97
|
// extensions of stylistic rules applied to the template tag
|
|
98
98
|
'vue/array-bracket-spacing': [
|
|
@@ -201,12 +201,12 @@ export default [
|
|
|
201
201
|
},
|
|
202
202
|
{
|
|
203
203
|
// IMPORTANT: These rules should be only applied to components, not pages. That's why we filter the files here
|
|
204
|
-
files: ['src/components/**/*'],
|
|
204
|
+
files: [ 'src/components/**/*' ],
|
|
205
205
|
rules: {
|
|
206
206
|
'vue/match-component-file-name': [
|
|
207
207
|
'error',
|
|
208
208
|
{
|
|
209
|
-
extensions: ['vue'],
|
|
209
|
+
extensions: [ 'vue' ],
|
|
210
210
|
shouldMatchCase: true,
|
|
211
211
|
},
|
|
212
212
|
],
|
|
@@ -214,7 +214,7 @@ export default [
|
|
|
214
214
|
},
|
|
215
215
|
},
|
|
216
216
|
{
|
|
217
|
-
files: ['src/**/*'], // exclude files from root folder
|
|
217
|
+
files: [ 'src/**/*' ], // exclude files from root folder
|
|
218
218
|
plugins: {
|
|
219
219
|
noRelativeImportPathsPlugin,
|
|
220
220
|
},
|