@infinitetoken/eslint-config 0.1.1 → 0.1.3

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 +8 -5
  2. package/package.json +8 -3
  3. package/vue.cjs +48 -0
package/README.md CHANGED
@@ -10,7 +10,8 @@ Shared ESLint (flat config) and Prettier rules for InfiniteToken TypeScript pack
10
10
  | `@infinitetoken/eslint-config/npm-package` | Any published npm package with no React Native or server specifics (kits, Node plugins) |
11
11
  | `@infinitetoken/eslint-config/react-native` | React Native packages; adds `eslint-plugin-react-hooks` and `eslint-plugin-react-native` |
12
12
  | `@infinitetoken/eslint-config/server` | Express/server apps; relaxed `no-unused-vars` (`^_` ignore pattern), `no-explicit-any: warn`, skips the `package.json` plugin since these aren't published |
13
- | `@infinitetoken/eslint-config/prettier` | The shared Prettier rules object, for `prettier.config.cjs` or the `"prettier"` field in `package.json` |
13
+ | `@infinitetoken/eslint-config/vue` | Vue/Nuxt apps; adds `vue-eslint-parser` + `eslint-plugin-vue`'s `flat/recommended`, no type-aware TS parsing (Nuxt's generated tsconfig makes that awkward), skips the `package.json` plugin since these aren't published |
14
+ | `@infinitetoken/eslint-config/prettier` | The shared Prettier rules object, for the `"prettier"` field in `package.json` |
14
15
 
15
16
  ## Usage
16
17
 
@@ -30,12 +31,14 @@ module.exports = defineConfig([
30
31
  ])
31
32
  ```
32
33
 
33
- ```js
34
- // prettier.config.cjs
35
- module.exports = require('@infinitetoken/eslint-config/prettier')
34
+ ```json
35
+ // package.json
36
+ {
37
+ "prettier": "@infinitetoken/eslint-config/prettier"
38
+ }
36
39
  ```
37
40
 
38
- `eslint` itself is a peer dependency (`^9.9.0 || ^10.0.0`); keep it as your own devDependency for the CLI binary. Most plugins the config requires (`typescript-eslint`, `eslint-plugin-prettier`, `eslint-plugin-simple-import-sort`, `eslint-plugin-package-json`, `prettier`) ship as regular dependencies of this package, so consumers don't list or version them individually.
41
+ `eslint` itself is a peer dependency (`^9.9.0 || ^10.0.0`); keep it as your own devDependency for the CLI binary. Most plugins the config requires (`typescript-eslint`, `eslint-plugin-prettier`, `eslint-plugin-simple-import-sort`, `eslint-plugin-package-json`, `eslint-plugin-vue`, `vue-eslint-parser`, `prettier`) ship as regular dependencies of this package, so consumers don't list or version them individually.
39
42
 
40
43
  `eslint-plugin-react-hooks` and `eslint-plugin-react-native` are the exception: they're optional peer dependencies instead, only needed by the `/react-native` preset. `eslint-plugin-react-native@5` currently only supports `eslint` up to v9, so bundling it as a regular dependency would force that ceiling onto every consumer, not just React Native ones. If you use the `/react-native` preset, add both as your own devDependencies (matching what the RN packages already do today).
41
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infinitetoken/eslint-config",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Shared ESLint and Prettier configuration for InfiniteToken TypeScript packages",
5
5
  "keywords": [
6
6
  "config",
@@ -25,13 +25,15 @@
25
25
  "./npm-package": "./npm-package.cjs",
26
26
  "./prettier": "./prettier.cjs",
27
27
  "./react-native": "./react-native.cjs",
28
- "./server": "./server.cjs"
28
+ "./server": "./server.cjs",
29
+ "./vue": "./vue.cjs"
29
30
  },
30
31
  "files": [
31
32
  "index.cjs",
32
33
  "npm-package.cjs",
33
34
  "react-native.cjs",
34
35
  "server.cjs",
36
+ "vue.cjs",
35
37
  "prettier.cjs"
36
38
  ],
37
39
  "scripts": {
@@ -45,14 +47,17 @@
45
47
  "test": "node scripts/verify-exports.cjs",
46
48
  "preversion": "npm run ci"
47
49
  },
50
+ "prettier": "./prettier.cjs",
48
51
  "dependencies": {
49
52
  "@typescript-eslint/parser": "^8.59.3",
50
53
  "eslint-config-prettier": "^10.1.8",
51
54
  "eslint-plugin-package-json": "^1.0.0",
52
55
  "eslint-plugin-prettier": "^5.5.5",
53
56
  "eslint-plugin-simple-import-sort": "^13.0.0",
57
+ "eslint-plugin-vue": "^10.9.1",
54
58
  "prettier": "^3.8.3",
55
- "typescript-eslint": "^8.59.3"
59
+ "typescript-eslint": "^8.59.3",
60
+ "vue-eslint-parser": "^10.4.0"
56
61
  },
57
62
  "devDependencies": {
58
63
  "eslint": "^9.39.4",
package/vue.cjs ADDED
@@ -0,0 +1,48 @@
1
+ const { defineConfig } = require('eslint/config')
2
+ const prettierRecommended = require('eslint-plugin-prettier/recommended')
3
+ const simpleImportSort = require('eslint-plugin-simple-import-sort')
4
+ const tsParser = require('@typescript-eslint/parser')
5
+ const tsEslint = require('typescript-eslint')
6
+ const vueParser = require('vue-eslint-parser')
7
+ const pluginVue = require('eslint-plugin-vue')
8
+
9
+ module.exports = defineConfig([
10
+ {
11
+ ignores: ['.nuxt/**', '.output/**', 'node_modules/**', 'coverage/**', 'dist/**', '**/*.mjs', '**/*.cjs']
12
+ },
13
+ {
14
+ files: ['**/*.ts'],
15
+ languageOptions: {
16
+ parser: tsParser,
17
+ parserOptions: {
18
+ extraFileExtensions: ['.vue']
19
+ }
20
+ }
21
+ },
22
+ {
23
+ files: ['**/*.vue'],
24
+ languageOptions: {
25
+ parser: vueParser,
26
+ parserOptions: {
27
+ parser: tsParser,
28
+ extraFileExtensions: ['.vue']
29
+ }
30
+ }
31
+ },
32
+ ...tsEslint.configs.recommended,
33
+ ...pluginVue.configs['flat/recommended'],
34
+ prettierRecommended,
35
+ {
36
+ plugins: {
37
+ 'simple-import-sort': simpleImportSort
38
+ },
39
+ rules: {
40
+ 'prettier/prettier': 'warn',
41
+ 'simple-import-sort/imports': 'warn',
42
+ 'simple-import-sort/exports': 'warn',
43
+ 'no-console': 'warn',
44
+ '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
45
+ '@typescript-eslint/no-require-imports': 'off'
46
+ }
47
+ }
48
+ ])