@nitra/eslint-config 3.1.4 → 3.1.6

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 (3) hide show
  1. package/README.md +18 -0
  2. package/index.js +42 -42
  3. package/package.json +4 -6
package/README.md CHANGED
@@ -15,6 +15,18 @@ bun add @nitra/eslint-config -D
15
15
 
16
16
  _Це лише спільна конфігурація. Prettier, ESLint та плагіни потрібно встановлювати окремо або вони підтягнуться як залежності._
17
17
 
18
+ ### Єдина версія `eslint-scope` (рекомендовано)
19
+
20
+ Щоб уникнути конфліктів версій `eslint-scope` між ESLint і плагінами (наприклад vue-eslint-parser), додайте **один раз** у кореневий `package.json` проєкту:
21
+
22
+ ```json
23
+ "overrides": {
24
+ "eslint-scope": "^9.1.0"
25
+ }
26
+ ```
27
+
28
+ Після цього виконайте `bun install` (або `npm install`). Override застосується до всього дерева залежностей проєкту.
29
+
18
30
  ## Використання
19
31
 
20
32
  У корені проєкту створіть **`eslint.config.js`** (або `eslint.config.mjs`):
@@ -32,17 +44,23 @@ export default getConfig({
32
44
  - **Тільки Node.js** — передайте лише `node`:
33
45
 
34
46
  ```js
47
+ import { getConfig } from '@nitra/eslint-config'
48
+
35
49
  export default getConfig({ node: ['.'] })
36
50
  ```
37
51
 
38
52
  - **Тільки Vue** — передайте лише `vue` або `vue2`:
39
53
 
40
54
  ```js
55
+ import { getConfig } from '@nitra/eslint-config'
56
+
41
57
  export default getConfig({ vue: ['src'] })
42
58
  ```
43
59
 
44
60
  - **Monorepo** — укажіть відповідні директорії:
45
61
  ```js
62
+ import { getConfig } from '@nitra/eslint-config'
63
+
46
64
  export default getConfig({
47
65
  node: ['apps/api', 'packages/cli'],
48
66
  vue: ['apps/web'],
package/index.js CHANGED
@@ -8,8 +8,8 @@ import nodePlugin from 'eslint-plugin-n'
8
8
  import oxlint from 'eslint-plugin-oxlint'
9
9
  // import securityPlugin from 'eslint-plugin-security'
10
10
  import unicornPlugin from 'eslint-plugin-unicorn'
11
- import vuePlugin from 'eslint-plugin-vue'
12
- import eslintYmlPlugin from 'eslint-plugin-yml'
11
+ // import vuePlugin from 'eslint-plugin-vue'
12
+ import { configs as ymlConfigs } from 'eslint-plugin-yml'
13
13
  import globals from 'globals'
14
14
  // import configStandard from 'eslint-config-standard'
15
15
 
@@ -28,7 +28,7 @@ const all = [
28
28
  ignores: ['.yarn/**', '**/dist/**']
29
29
  },
30
30
  // Загальні правила для всіх Yaml файлів проекту
31
- ...eslintYmlPlugin.configs['flat/prettier'],
31
+ ...ymlConfigs['flat/prettier'],
32
32
  // Загальні правила для всіх MD файлів проекту
33
33
  // @ts-ignore
34
34
  ...markdownPlugin.configs.recommended,
@@ -137,45 +137,45 @@ const vueAllVite = [
137
137
  // Для Vue файлів Vue проектів
138
138
  // files: ['**/*.vue']
139
139
  const vue = [
140
- ...vuePlugin.configs['flat/recommended'],
141
- {
142
- rules: {
143
- 'vue/no-v-html': 'off',
144
- 'vue/html-indent': 'off',
145
- 'vue/max-attributes-per-line': 'off',
146
- 'vue/html-closing-bracket-newline': 'off',
147
- 'vue/singleline-html-element-content-newline': 'off',
148
- 'vue/multi-word-component-names': 'off',
149
- 'vue/html-self-closing': [
150
- 'error',
151
- {
152
- html: {
153
- void: 'always' // під преттієр https://github.com/prettier/prettier/issues/5641
154
- }
155
- }
156
- ],
157
- // Нітра порядок сортування
158
- 'vue/attributes-order': [
159
- 'error',
160
- {
161
- order: [
162
- 'DEFINITION',
163
- 'LIST_RENDERING',
164
- 'CONDITIONALS',
165
- 'RENDER_MODIFIERS',
166
- 'GLOBAL',
167
- ['UNIQUE', 'SLOT'],
168
- 'TWO_WAY_BINDING',
169
- 'OTHER_DIRECTIVES',
170
- 'EVENTS',
171
- 'OTHER_ATTR',
172
- 'CONTENT'
173
- ],
174
- alphabetical: false
175
- }
176
- ]
177
- }
178
- }
140
+ // ...vuePlugin.configs['flat/recommended'],
141
+ // {
142
+ // rules: {
143
+ // 'vue/no-v-html': 'off',
144
+ // 'vue/html-indent': 'off',
145
+ // 'vue/max-attributes-per-line': 'off',
146
+ // 'vue/html-closing-bracket-newline': 'off',
147
+ // 'vue/singleline-html-element-content-newline': 'off',
148
+ // 'vue/multi-word-component-names': 'off',
149
+ // 'vue/html-self-closing': [
150
+ // 'error',
151
+ // {
152
+ // html: {
153
+ // void: 'always' // під преттієр https://github.com/prettier/prettier/issues/5641
154
+ // }
155
+ // }
156
+ // ],
157
+ // // Нітра порядок сортування
158
+ // 'vue/attributes-order': [
159
+ // 'error',
160
+ // {
161
+ // order: [
162
+ // 'DEFINITION',
163
+ // 'LIST_RENDERING',
164
+ // 'CONDITIONALS',
165
+ // 'RENDER_MODIFIERS',
166
+ // 'GLOBAL',
167
+ // ['UNIQUE', 'SLOT'],
168
+ // 'TWO_WAY_BINDING',
169
+ // 'OTHER_DIRECTIVES',
170
+ // 'EVENTS',
171
+ // 'OTHER_ATTR',
172
+ // 'CONTENT'
173
+ // ],
174
+ // alphabetical: false
175
+ // }
176
+ // ]
177
+ // }
178
+ // }
179
179
  ]
180
180
 
181
181
  const vue2 = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nitra/eslint-config",
3
- "version": "3.1.4",
3
+ "version": "3.1.6",
4
4
  "description": "A Eslint shareable config for projects using 'Vue' and 'Node'",
5
5
  "keywords": [
6
6
  "eslint",
@@ -20,18 +20,16 @@
20
20
  "exports": "./index.js",
21
21
  "dependencies": {
22
22
  "@eslint/js": "^10.0.1",
23
- "eslint": "^10.0.0",
24
23
  "eslint-config-prettier": "^10.1.8",
25
24
  "eslint-plugin-import": "^2.32.0",
26
- "eslint-plugin-jsdoc": "^62.5.3",
25
+ "eslint-plugin-jsdoc": "^62.5.4",
27
26
  "eslint-plugin-markdown": "^5.1.0",
28
27
  "eslint-plugin-n": "^17.23.2",
29
28
  "eslint-plugin-oxlint": "^1.43.0",
30
29
  "eslint-plugin-unicorn": "^62.0.0",
31
- "eslint-plugin-vue": "^10.7.0",
32
30
  "eslint-plugin-yml": "^3.1.2",
33
- "globals": "^17.3.0",
34
- "vue-eslint-parser": "^10.2.0"
31
+ "eslint-scope": "^9.1.0",
32
+ "globals": "^17.3.0"
35
33
  },
36
34
  "engines": {
37
35
  "node": ">=20.19.0"