@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.
Files changed (4) hide show
  1. package/README.md +73 -89
  2. package/cypress.js +1 -1
  3. package/package.json +10 -10
  4. package/test.js +5 -0
package/README.md CHANGED
@@ -1,129 +1,113 @@
1
- # planfred-eslint-config
1
+ # @planfredapp/eslint-config
2
2
 
3
- Shared ESLint configurations for the Planfred monorepo.
3
+ [![npm version](https://img.shields.io/npm/v/@planfredapp/eslint-config.svg)](https://www.npmjs.com/package/@planfredapp/eslint-config)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
4
5
 
5
- ## Available Configurations
6
+ Shared ESLint configurations for the Planfred monorepo. Uses ESLint 9 flat config format.
6
7
 
7
- ### Base Configuration
8
+ ## Installation
8
9
 
9
- The base configuration includes common rules and plugins used across all projects:
10
-
11
- - Standard JavaScript rules
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
- Extends the base configuration with testing framework rules:
14
+ ## Configurations
37
15
 
38
- - Vitest support
39
- - Test-specific globals
40
- - Testing best practices
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
- ### In ESLint Config Files
25
+ Create `eslint.config.js` in your project root:
45
26
 
46
27
  ```javascript
47
- // For base configuration
28
+ // Base config
48
29
  import baseConfig from '@planfredapp/eslint-config/base'
30
+ export default [...baseConfig]
49
31
 
50
- export default [
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
- // your specific overrides
40
+ {
41
+ rules: {
42
+ 'no-console': 'warn',
43
+ },
44
+ },
61
45
  ]
46
+ ```
62
47
 
63
- // For Cypress tests
64
- import cypressConfig from '@planfredapp/eslint-config/cypress'
48
+ ## Included Plugins
65
49
 
66
- export default [
67
- ...cypressConfig,
68
- // your specific overrides
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
- // For test files
72
- import testConfig from '@planfredapp/eslint-config/test'
57
+ ### Vue Config
58
+ - `eslint-plugin-vue` - Vue 3 rules
59
+ - `eslint-plugin-no-relative-import-paths` - Enforce `@/` imports
73
60
 
74
- export default [
75
- ...testConfig,
76
- // your specific overrides
77
- ]
78
- ```
61
+ ### Cypress Config
62
+ - `eslint-plugin-cypress` - Cypress globals and best practices
63
+ - `typescript-eslint` - TypeScript support
79
64
 
80
- ### Package.json Dependencies
65
+ ### Test Config
66
+ - `@vitest/eslint-plugin` - Vitest globals and rules
67
+ - `eslint-plugin-no-only-tests` - Prevent `.only()` in CI
81
68
 
82
- Add the shared config as a dependency in your package.json:
69
+ ## Key Rules
83
70
 
84
- ```json
85
- {
86
- "devDependencies": {
87
- "@planfredapp/eslint-config": "^1.0.12"
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
- Or install directly with npm:
79
+ ### Imports
80
+ - Alphabetized, grouped by type
81
+ - Newlines between groups
82
+ - No relative paths in Vue (use `@/`)
93
83
 
94
- ```bash
95
- npm install --save-dev @planfredapp/eslint-config
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
- ### Available Versions
99
-
100
- You can install specific versions:
90
+ ## Peer Dependencies
101
91
 
102
92
  ```json
103
93
  {
104
- "devDependencies": {
105
- "@planfredapp/eslint-config": "1.0.12"
106
- }
94
+ "eslint": "9.0.0"
107
95
  }
108
96
  ```
109
97
 
110
- Or use the latest version:
98
+ ## Files
111
99
 
112
- ```json
113
- {
114
- "devDependencies": {
115
- "@planfredapp/eslint-config": "latest"
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
- ## Configuration Structure
107
+ ## Changelog
121
108
 
122
- The shared configurations are organized as follows:
109
+ See [CHANGELOG.md](CHANGELOG.md) for version history.
123
110
 
124
- - `base.js` - Core configuration with common rules
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
- Each configuration can be extended and overridden as needed in individual projects.
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/flat'
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.52",
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.7.0",
50
- "@vitest/eslint-plugin": "1.6.6",
51
- "eslint-plugin-cypress": "5.2.1",
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.23.2",
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.7.0",
58
- "globals": "17.1.0",
59
- "typescript-eslint": "8.53.1"
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.2.0"
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"
package/test.js CHANGED
@@ -12,6 +12,11 @@ export default [
12
12
  noOnlyTestsPlugin,
13
13
  vitest: vitestPlugin,
14
14
  },
15
+ settings: {
16
+ vitest: {
17
+ typecheck: false,
18
+ },
19
+ },
15
20
  languageOptions: {
16
21
  globals: {
17
22
  ...globals.node,