@planfredapp/eslint-config 1.0.52 → 1.0.55
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/cypress.js +1 -1
- package/package.json +10 -10
- package/test.js +5 -0
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/cypress.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @type {import('eslint').Linter.Config[]} */
|
|
2
|
-
import cypressPlugin from 'eslint-plugin-cypress
|
|
2
|
+
import cypressPlugin from 'eslint-plugin-cypress'
|
|
3
3
|
import noOnlyTestsPlugin from 'eslint-plugin-no-only-tests'
|
|
4
4
|
import globals from 'globals'
|
|
5
5
|
import tsEslint from 'typescript-eslint'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planfredapp/eslint-config",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.55",
|
|
4
4
|
"description": "Shared ESLint configurations for Planfred monorepo",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -46,26 +46,26 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@eslint/js": "9.39.2",
|
|
49
|
-
"@stylistic/eslint-plugin": "5.
|
|
50
|
-
"@vitest/eslint-plugin": "1.6.
|
|
51
|
-
"eslint-plugin-cypress": "
|
|
49
|
+
"@stylistic/eslint-plugin": "5.9.0",
|
|
50
|
+
"@vitest/eslint-plugin": "1.6.9",
|
|
51
|
+
"eslint-plugin-cypress": "6.1.0",
|
|
52
52
|
"eslint-plugin-import": "2.32.0",
|
|
53
|
-
"eslint-plugin-n": "17.
|
|
53
|
+
"eslint-plugin-n": "17.24.0",
|
|
54
54
|
"eslint-plugin-no-only-tests": "3.3.0",
|
|
55
55
|
"eslint-plugin-no-relative-import-paths": "1.6.1",
|
|
56
56
|
"eslint-plugin-promise": "7.2.1",
|
|
57
|
-
"eslint-plugin-vue": "10.
|
|
58
|
-
"globals": "17.
|
|
59
|
-
"typescript-eslint": "8.
|
|
57
|
+
"eslint-plugin-vue": "10.8.0",
|
|
58
|
+
"globals": "17.3.0",
|
|
59
|
+
"typescript-eslint": "8.56.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"eslint": "9.39.2",
|
|
63
63
|
"typescript": "5.9.3",
|
|
64
64
|
"vitest": "4.0.18",
|
|
65
|
-
"vue-eslint-parser": "10.
|
|
65
|
+
"vue-eslint-parser": "10.4.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"
|