@infinitetoken/eslint-config 0.1.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/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2026 Infinite Token LLC (https://www.infinitetoken.com/)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # @infinitetoken/eslint-config
2
+
3
+ Shared ESLint (flat config) and Prettier rules for InfiniteToken TypeScript packages.
4
+
5
+ ## Presets
6
+
7
+ | Export | Use for |
8
+ | --- | --- |
9
+ | `@infinitetoken/eslint-config` | Universal core (TS recommended, prettier, import sort); rarely used directly |
10
+ | `@infinitetoken/eslint-config/npm-package` | Any published npm package with no React Native or server specifics (kits, Node plugins) |
11
+ | `@infinitetoken/eslint-config/react-native` | React Native packages; adds `eslint-plugin-react-hooks` and `eslint-plugin-react-native` |
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` |
14
+
15
+ ## Usage
16
+
17
+ ```js
18
+ // eslint.config.cjs
19
+ module.exports = require('@infinitetoken/eslint-config/react-native')
20
+ ```
21
+
22
+ Repo-specific overrides (extra ignores, a one-off rule exception) stay local, composed in the same file:
23
+
24
+ ```js
25
+ const { defineConfig } = require('eslint/config')
26
+
27
+ module.exports = defineConfig([
28
+ ...require('@infinitetoken/eslint-config/react-native'),
29
+ { ignores: ['some-repo-specific-dir/**'] }
30
+ ])
31
+ ```
32
+
33
+ ```js
34
+ // prettier.config.cjs
35
+ module.exports = require('@infinitetoken/eslint-config/prettier')
36
+ ```
37
+
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.
39
+
40
+ `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
+
42
+ ## Release
43
+
44
+ Tag-based, using npm trusted publishing (OIDC, no token required):
45
+
46
+ ```bash
47
+ npm version patch # or minor / major
48
+ git push --follow-tags
49
+ ```
package/index.cjs ADDED
@@ -0,0 +1,35 @@
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
+
7
+ module.exports = defineConfig([
8
+ {
9
+ files: ['**/*.ts', '**/*.tsx'],
10
+ languageOptions: {
11
+ parser: tsParser,
12
+ parserOptions: {
13
+ project: './tsconfig.json'
14
+ }
15
+ }
16
+ },
17
+ {
18
+ ignores: ['dist/**', 'node_modules/**', 'lib/**', 'coverage/**', '**/*.js', '**/*.mjs']
19
+ },
20
+ ...tsEslint.configs.recommended,
21
+ prettierRecommended,
22
+ {
23
+ plugins: {
24
+ 'simple-import-sort': simpleImportSort
25
+ },
26
+ rules: {
27
+ 'prettier/prettier': 'warn',
28
+ 'simple-import-sort/imports': 'warn',
29
+ 'simple-import-sort/exports': 'warn',
30
+ 'no-console': 'warn',
31
+ '@typescript-eslint/no-unused-vars': 'warn',
32
+ '@typescript-eslint/no-require-imports': 'off'
33
+ }
34
+ }
35
+ ])
@@ -0,0 +1,16 @@
1
+ const { defineConfig } = require('eslint/config')
2
+ const packageJson = require('eslint-plugin-package-json')
3
+ const base = require('./index.cjs')
4
+
5
+ module.exports = defineConfig([
6
+ ...base,
7
+ packageJson.configs.recommended,
8
+ {
9
+ extends: [packageJson.configs.recommended],
10
+ files: ['package.json'],
11
+ rules: {
12
+ 'package-json/order-properties': 'warn',
13
+ 'package-json/sort-collections': 'warn'
14
+ }
15
+ }
16
+ ])
package/package.json ADDED
@@ -0,0 +1,78 @@
1
+ {
2
+ "name": "@infinitetoken/eslint-config",
3
+ "version": "0.1.0",
4
+ "description": "Shared ESLint and Prettier configuration for InfiniteToken TypeScript packages",
5
+ "keywords": [
6
+ "config",
7
+ "eslint",
8
+ "eslintconfig",
9
+ "prettier"
10
+ ],
11
+ "homepage": "https://github.com/infinitetoken/eslint-config#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/infinitetoken/eslint-config/issues"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/infinitetoken/eslint-config.git"
18
+ },
19
+ "license": "MIT",
20
+ "author": "Jay Deaton",
21
+ "sideEffects": false,
22
+ "type": "commonjs",
23
+ "exports": {
24
+ ".": "./index.cjs",
25
+ "./npm-package": "./npm-package.cjs",
26
+ "./prettier": "./prettier.cjs",
27
+ "./react-native": "./react-native.cjs",
28
+ "./server": "./server.cjs"
29
+ },
30
+ "files": [
31
+ "index.cjs",
32
+ "npm-package.cjs",
33
+ "react-native.cjs",
34
+ "server.cjs",
35
+ "prettier.cjs"
36
+ ],
37
+ "scripts": {
38
+ "ci": "npm run lint && npm test",
39
+ "fix": "eslint . --fix",
40
+ "lint": "eslint .",
41
+ "release": "git push --follow-tags",
42
+ "release:major": "npm version major && npm run release",
43
+ "release:minor": "npm version minor && npm run release",
44
+ "release:patch": "npm version patch && npm run release",
45
+ "test": "node scripts/verify-exports.cjs",
46
+ "preversion": "npm run ci"
47
+ },
48
+ "dependencies": {
49
+ "@typescript-eslint/parser": "^8.59.3",
50
+ "eslint-config-prettier": "^10.1.8",
51
+ "eslint-plugin-package-json": "^1.0.0",
52
+ "eslint-plugin-prettier": "^5.5.5",
53
+ "eslint-plugin-simple-import-sort": "^13.0.0",
54
+ "prettier": "^3.8.3",
55
+ "typescript-eslint": "^8.59.3"
56
+ },
57
+ "devDependencies": {
58
+ "eslint": "^9.39.4",
59
+ "eslint-plugin-react-hooks": "^7.1.1",
60
+ "eslint-plugin-react-native": "^5.0.0"
61
+ },
62
+ "peerDependencies": {
63
+ "eslint": "^9.9.0 || ^10.0.0",
64
+ "eslint-plugin-react-hooks": "^7.0.0",
65
+ "eslint-plugin-react-native": "^5.0.0"
66
+ },
67
+ "peerDependenciesMeta": {
68
+ "eslint-plugin-react-hooks": {
69
+ "optional": true
70
+ },
71
+ "eslint-plugin-react-native": {
72
+ "optional": true
73
+ }
74
+ },
75
+ "publishConfig": {
76
+ "access": "public"
77
+ }
78
+ }
package/prettier.cjs ADDED
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ jsxSingleQuote: true,
3
+ printWidth: 1000,
4
+ semi: false,
5
+ singleQuote: true,
6
+ trailingComma: 'none'
7
+ }
@@ -0,0 +1,27 @@
1
+ const { defineConfig } = require('eslint/config')
2
+ const reactHooks = require('eslint-plugin-react-hooks')
3
+ const eslintReactNative = require('eslint-plugin-react-native')
4
+ const npmPackage = require('./npm-package.cjs')
5
+
6
+ module.exports = defineConfig([
7
+ ...npmPackage,
8
+ {
9
+ plugins: {
10
+ 'react-hooks': reactHooks,
11
+ 'react-native': eslintReactNative
12
+ },
13
+ rules: {
14
+ 'react-native/no-inline-styles': 'warn',
15
+ 'react-native/no-unused-styles': 'warn',
16
+ 'react-native/no-raw-text': 'off',
17
+ // rules-of-hooks stays at error since it's the foundational hook-ordering check, not a
18
+ // judgment call. The rest match the fleet's severities (warn, not error).
19
+ 'react-hooks/rules-of-hooks': 'error',
20
+ 'react-hooks/exhaustive-deps': 'warn',
21
+ 'react-hooks/refs': 'warn',
22
+ 'react-hooks/immutability': 'warn',
23
+ 'react-hooks/preserve-manual-memoization': 'warn',
24
+ 'react-hooks/set-state-in-effect': 'warn'
25
+ }
26
+ }
27
+ ])
package/server.cjs ADDED
@@ -0,0 +1,18 @@
1
+ const { defineConfig } = require('eslint/config')
2
+ const base = require('./index.cjs')
3
+
4
+ module.exports = defineConfig([
5
+ ...base,
6
+ {
7
+ rules: {
8
+ '@typescript-eslint/no-unused-vars': ['warn', { varsIgnorePattern: '^_', argsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' }],
9
+ '@typescript-eslint/no-explicit-any': 'warn'
10
+ }
11
+ },
12
+ {
13
+ files: ['**/__tests__/**/*.ts'],
14
+ rules: {
15
+ '@typescript-eslint/no-explicit-any': 'off'
16
+ }
17
+ }
18
+ ])