@infinitetoken/eslint-config 0.1.7 → 0.2.0

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
@@ -9,6 +9,7 @@ Shared ESLint (flat config) and Prettier rules for InfiniteToken TypeScript pack
9
9
  | `@infinitetoken/eslint-config` | Universal core (TS recommended, prettier, import sort); rarely used directly. Always ignores `dist/**`, `node_modules/**`, `lib/**`, `coverage/**`, `**/*.js`, `**/*.mjs`, `.claude/worktrees/**` (a Claude Code artifact directory present across the whole fleet), and `.yalc/**` (yalc-linked packages snapshot their `.d.ts`/`.d.mts` output too, not just compiled JS — those crash the type-aware parser the same as any other out-of-project `.ts` file if not ignored) |
10
10
  | `@infinitetoken/eslint-config/npm-package` | Any published npm package with no React Native or server specifics (kits, Node plugins). Also ignores `tsup.config.ts` (a no-op if the package doesn't have one — it sits outside the rootDir-scoped tsconfig most kit packages use, which trips the type-aware parser if linted) and turns off `no-explicit-any` under `**/__tests__/**` and `**/__mocks__/**` — those directories are linted like anywhere else (formatting, import sort, unused vars), not excluded; `any` is just a reasonable choice there for casting fixtures and mocking modules |
11
11
  | `@infinitetoken/eslint-config/react-native` | React Native packages; adds `eslint-plugin-react-hooks` and `eslint-plugin-react-native` |
12
+ | `@infinitetoken/eslint-config/expo` | Expo apps (not libraries); layers `eslint-config-expo/flat` underneath `/react-native`, so the fleet's conventions (the `^_` unused-vars pattern, import sort, `package.json` rules, etc.) win over Expo's own defaults. Also ignores `ios/**`, `android/**`, `.expo/**`, `.vscode/**` |
12
13
  | `@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
14
  | `@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) |
14
15
  | `@infinitetoken/eslint-config/prettier` | The shared Prettier rules object, for the `"prettier"` field in `package.json` |
@@ -40,7 +41,7 @@ module.exports = defineConfig([
40
41
 
41
42
  `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.
42
43
 
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).
44
+ `eslint-plugin-react-hooks`, `eslint-plugin-react-native`, and `eslint-config-expo` are the exception: they're optional peer dependencies instead, only needed by the `/react-native` and `/expo` presets. `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. `eslint-config-expo` is versioned to track a specific Expo SDK release (this package pins `^57.0.0`, matching Expo SDK 57), so bundling it would tie every consumer — including non-Expo ones — to one SDK's requirements. If you use the `/react-native` preset, add `eslint-plugin-react-hooks` and `eslint-plugin-react-native` as your own devDependencies; if you use `/expo`, add those two plus `eslint-config-expo` (matching what the RN/Expo apps already do today).
44
45
 
45
46
  ## Release
46
47
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infinitetoken/eslint-config",
3
- "version": "0.1.7",
3
+ "version": "0.2.0",
4
4
  "description": "Shared ESLint and Prettier configuration for InfiniteToken TypeScript packages",
5
5
  "keywords": [
6
6
  "config",
@@ -22,6 +22,7 @@
22
22
  "type": "commonjs",
23
23
  "exports": {
24
24
  ".": "./src/index.cjs",
25
+ "./expo": "./src/expo.cjs",
25
26
  "./npm-package": "./src/npm-package.cjs",
26
27
  "./prettier": "./src/prettier.cjs",
27
28
  "./react-native": "./src/react-native.cjs",
@@ -57,15 +58,20 @@
57
58
  },
58
59
  "devDependencies": {
59
60
  "eslint": "^9.39.4",
61
+ "eslint-config-expo": "^57.0.2",
60
62
  "eslint-plugin-react-hooks": "^7.1.1",
61
63
  "eslint-plugin-react-native": "^5.0.0"
62
64
  },
63
65
  "peerDependencies": {
64
66
  "eslint": "^9.9.0 || ^10.0.0",
67
+ "eslint-config-expo": "^57.0.0",
65
68
  "eslint-plugin-react-hooks": "^7.0.0",
66
69
  "eslint-plugin-react-native": "^5.0.0"
67
70
  },
68
71
  "peerDependenciesMeta": {
72
+ "eslint-config-expo": {
73
+ "optional": true
74
+ },
69
75
  "eslint-plugin-react-hooks": {
70
76
  "optional": true
71
77
  },
package/src/expo.cjs ADDED
@@ -0,0 +1,11 @@
1
+ const { defineConfig } = require('eslint/config')
2
+ const expoConfig = require('eslint-config-expo/flat')
3
+ const reactNative = require('./react-native.cjs')
4
+
5
+ module.exports = defineConfig([
6
+ {
7
+ ignores: ['ios/**', 'android/**', '.expo/**', '.vscode/**']
8
+ },
9
+ ...expoConfig,
10
+ ...reactNative
11
+ ])
package/src/index.cjs CHANGED
@@ -28,7 +28,13 @@ module.exports = defineConfig([
28
28
  'simple-import-sort/imports': 'warn',
29
29
  'simple-import-sort/exports': 'warn',
30
30
  'no-console': 'warn',
31
- '@typescript-eslint/no-unused-vars': 'warn',
31
+ // '_'-prefixed unused var/arg/caught-error bindings are a deliberate "I need this position,
32
+ // not this value" signal (most commonly an object-destructure used only to omit a key, e.g.
33
+ // `const { id: _id, ...rest } = obj` — unlike array destructuring, an object key binding can't
34
+ // be elided) and shouldn't warn. Universal fleet-wide: a grep across every repo in the fleet
35
+ // found zero consumers of this bare `.` export, so there's no real "wants the plain warn
36
+ // instead" consumer to preserve by scoping this to individual presets instead.
37
+ '@typescript-eslint/no-unused-vars': ['warn', { varsIgnorePattern: '^_', argsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' }],
32
38
  '@typescript-eslint/no-require-imports': 'off'
33
39
  }
34
40
  }
@@ -14,6 +14,7 @@ module.exports = defineConfig([
14
14
  'react-native/no-inline-styles': 'warn',
15
15
  'react-native/no-unused-styles': 'warn',
16
16
  'react-native/no-raw-text': 'off',
17
+ 'react-native/sort-styles': 'warn',
17
18
  // rules-of-hooks stays at error since it's the foundational hook-ordering check, not a
18
19
  // judgment call. The rest match the fleet's severities (warn, not error).
19
20
  'react-hooks/rules-of-hooks': 'error',
package/src/server.cjs CHANGED
@@ -5,7 +5,6 @@ module.exports = defineConfig([
5
5
  ...base,
6
6
  {
7
7
  rules: {
8
- '@typescript-eslint/no-unused-vars': ['warn', { varsIgnorePattern: '^_', argsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' }],
9
8
  '@typescript-eslint/no-explicit-any': 'warn'
10
9
  }
11
10
  },