@nitra/eslint-config 3.2.0 → 3.2.2

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 CHANGED
@@ -33,7 +33,7 @@ export default getConfig({
33
33
 
34
34
  ```js
35
35
  import { getConfig } from '@nitra/eslint-config'
36
-
36
+
37
37
  export default getConfig({ node: ['.'] })
38
38
  ```
39
39
 
@@ -41,14 +41,15 @@ export default getConfig({
41
41
 
42
42
  ```js
43
43
  import { getConfig } from '@nitra/eslint-config'
44
-
44
+
45
45
  export default getConfig({ vue: ['src'] })
46
46
  ```
47
47
 
48
48
  - **Monorepo** — укажіть відповідні директорії:
49
+
49
50
  ```js
50
51
  import { getConfig } from '@nitra/eslint-config'
51
-
52
+
52
53
  export default getConfig({
53
54
  node: ['apps/api', 'packages/cli'],
54
55
  vue: ['apps/web'],
package/index.d.ts ADDED
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Параметри для getConfig — список директорій для застосування правил.
3
+ */
4
+ export interface GetConfigParams {
5
+ /** Шляхи до Node.js коду */
6
+ node?: string[]
7
+ /** Шляхи до Vue 3 */
8
+ vue?: string[]
9
+ /** Шляхи до Vue 2 */
10
+ vue2?: string[]
11
+ }
12
+
13
+ /**
14
+ * Один елемент ESLint flat config (сумісний з Linter.FlatConfig).
15
+ * У проєктах з встановленим eslint типи будуть зв’язані автоматично.
16
+ */
17
+ export type FlatConfig = Record<string, unknown>
18
+
19
+ /**
20
+ * ESLint flat config для проєктів на Vue та Node.
21
+ * @param params — список директорій для застосування правил
22
+ * @returns масив конфігурацій ESLint (flat config)
23
+ */
24
+ export function getConfig(params?: GetConfigParams): FlatConfig[]
package/index.js CHANGED
@@ -186,7 +186,7 @@ const vue2 = [
186
186
  * Додає до result конфіги для Vue-проєктів (vite, .vue, .js).
187
187
  * @param {Array} result масив конфігів
188
188
  * @param {string[]} dirs директорії Vue-проєктів
189
- * @param {{ includeVite?: boolean, extraVueConfigs?: Array }} [options]
189
+ * @param {{ includeVite?: boolean, extraVueConfigs?: Array }} [options] опції: includeVite, extraVueConfigs
190
190
  */
191
191
  function pushVueConfigs(result, dirs, options = {}) {
192
192
  const { includeVite = false, extraVueConfigs = [] } = options
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nitra/eslint-config",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
4
4
  "description": "An ESLint shareable config for projects using Vue and Node",
5
5
  "keywords": [
6
6
  "eslint",
@@ -13,11 +13,12 @@
13
13
  "type": "git",
14
14
  "url": "git@github.com:nitra/eslint-config.git"
15
15
  },
16
- "types": "index.d.ts",
17
16
  "files": [
17
+ "index.d.ts",
18
18
  "index.js"
19
19
  ],
20
20
  "type": "module",
21
+ "types": "./index.d.ts",
21
22
  "exports": "./index.js",
22
23
  "dependencies": {
23
24
  "@eslint/js": "^10.0.1",
@@ -30,7 +31,8 @@
30
31
  "eslint-plugin-unicorn": "^62.0.0",
31
32
  "eslint-plugin-vue": "^10.7.0",
32
33
  "eslint-plugin-yml": "^3.1.2",
33
- "globals": "^17.3.0"
34
+ "globals": "^17.3.0",
35
+ "vue-eslint-parser": "^10.3.0"
34
36
  },
35
37
  "engines": {
36
38
  "node": ">=20.19.0"