@cogs/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/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # @cogs/eslint-config
2
+
3
+ Shared flat ESLint (v9+) configuration for the catesworks fleet. Exports a single
4
+ `createConfig` factory that returns an array of flat config objects covering base
5
+ JS/TS rules (typed via `typescript-eslint` `projectService`), import hygiene
6
+ (`eslint-plugin-import` + `eslint-import-resolver-typescript`), React + hooks +
7
+ JSX a11y, TanStack Query, MD/MDX linting, Jest and Testing Library rules for test
8
+ files, and Prettier conflict-disabling — so every repo lints the same way without
9
+ copy-pasting an `eslint.config.mjs`.
10
+
11
+ ## Install
12
+
13
+ ```sh
14
+ pnpm add -D @cogs/eslint-config eslint
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ In your repo's `eslint.config.mjs`:
20
+
21
+ ```js
22
+ import { createConfig } from '@cogs/eslint-config'
23
+
24
+ export default createConfig({
25
+ tsconfigRootDir: import.meta.dirname,
26
+ })
27
+ ```
28
+
29
+ `createConfig` accepts:
30
+
31
+ - `additionalIgnores?: string[]` — extra glob patterns appended to the fleet-wide ignore defaults
32
+ - `tsconfigRootDir?: string` — root dir passed to typescript-eslint's `projectService` (defaults to `process.cwd()`)
33
+ - `tsProjects?: string[]` — tsconfig paths used by `eslint-import-resolver-typescript` (defaults to `['./tsconfig.json']`)
34
+ - `internalRegex?: string` — regex identifying "internal" workspace imports for import ordering (defaults to `^@cogs/`)
35
+ - `react?: boolean` — enable the React + React Hooks + JSX a11y rule sets (defaults to `true`; set `false` for non-React packages)
36
+ - `packageDirs?: string[]` — directories to search when checking for extraneous dependencies
37
+
38
+ Need repo-specific tweaks? Spread and append:
39
+
40
+ ```js
41
+ import { createConfig } from '@cogs/eslint-config'
42
+
43
+ export default [
44
+ ...createConfig({ tsconfigRootDir: import.meta.dirname }),
45
+ {
46
+ files: ['src/legacy/**/*.ts'],
47
+ rules: { '@typescript-eslint/no-explicit-any': 'off' },
48
+ },
49
+ ]
50
+ ```
@@ -0,0 +1,18 @@
1
+ import type { Linter } from 'eslint';
2
+ export interface CreateConfigOptions {
3
+ /** Extra glob patterns to ignore, appended to the fleet-wide defaults. */
4
+ additionalIgnores?: string[];
5
+ /** Root dir passed to typescript-eslint's `projectService` for typed rules. */
6
+ tsconfigRootDir?: string;
7
+ /** tsconfig paths used by `eslint-import-resolver-typescript`. */
8
+ tsProjects?: string[];
9
+ /** Regex identifying "internal" (workspace) imports for import/order. */
10
+ internalRegex?: string;
11
+ /** Whether to enable the React + JSX a11y rule sets. Defaults to `true`. */
12
+ react?: boolean;
13
+ /** Directories to search for nearest `package.json` when checking for extraneous deps. */
14
+ packageDirs?: string[];
15
+ }
16
+ export declare const createConfig: ({ additionalIgnores, tsconfigRootDir, tsProjects, internalRegex, react, packageDirs, }?: CreateConfigOptions) => Linter.Config[];
17
+ export default createConfig;
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAA;AAyD5C,MAAM,WAAW,mBAAmB;IAClC,0EAA0E;IAC1E,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC5B,+EAA+E;IAC/E,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,yEAAyE;IACzE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,0FAA0F;IAC1F,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CACvB;AAED,eAAO,MAAM,YAAY,GAAI,yFAO1B,mBAAwB,KAAG,MAAM,CAAC,MAAM,EA4Q1C,CAAA;AAED,eAAe,YAAY,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,300 @@
1
+ import path from 'node:path';
2
+ import { fixupPluginRules } from '@eslint/compat';
3
+ import js from '@eslint/js';
4
+ import tanstackQuery from '@tanstack/eslint-plugin-query';
5
+ import prettier from 'eslint-config-prettier';
6
+ import canonical from 'eslint-plugin-canonical';
7
+ import importPlugin from 'eslint-plugin-import';
8
+ import jest from 'eslint-plugin-jest';
9
+ import a11y from 'eslint-plugin-jsx-a11y';
10
+ import * as mdx from 'eslint-plugin-mdx';
11
+ import reactPlugin from 'eslint-plugin-react';
12
+ import reactHooks from 'eslint-plugin-react-hooks';
13
+ import testingLibrary from 'eslint-plugin-testing-library';
14
+ import globals from 'globals';
15
+ import * as tseslint from 'typescript-eslint';
16
+ /**
17
+ * Shared flat ESLint configuration for the catesworks fleet.
18
+ *
19
+ * Consume it from a repo's `eslint.config.mjs`:
20
+ *
21
+ * ```js
22
+ * import { createConfig } from '@cogs/eslint-config'
23
+ *
24
+ * export default createConfig({
25
+ * tsconfigRootDir: import.meta.dirname,
26
+ * })
27
+ * ```
28
+ */
29
+ const DEFAULT_IGNORES = [
30
+ '**/node_modules/**',
31
+ '.pnp',
32
+ '**/.pnp.js',
33
+ '.yarn/install-state.gz',
34
+ 'dist/**',
35
+ 'out/**',
36
+ '.next/**',
37
+ 'build',
38
+ 'build/**',
39
+ 'lib',
40
+ 'lib/**',
41
+ '.turbo/**',
42
+ 'coverage/**',
43
+ '.vercel/**',
44
+ '**/.DS_Store',
45
+ '**/*.pem',
46
+ '**/cert/**',
47
+ '**/npm-debug.log*',
48
+ '**/yarn-debug.log*',
49
+ '**/yarn-error.log*',
50
+ '**/.env*.local',
51
+ '**/*.tsbuildinfo',
52
+ '**/next-env.d.ts',
53
+ '**/storybook-static/**',
54
+ ];
55
+ const DEFAULT_TS_PROJECTS = ['./tsconfig.json'];
56
+ const DEFAULT_INTERNAL_REGEX = '^@cogs/';
57
+ export const createConfig = ({ additionalIgnores = [], tsconfigRootDir = process.cwd(), tsProjects = DEFAULT_TS_PROJECTS, internalRegex = DEFAULT_INTERNAL_REGEX, react = true, packageDirs, } = {}) => {
58
+ const ignores = [...DEFAULT_IGNORES, ...additionalIgnores];
59
+ const resolvedPackageDirs = packageDirs ??
60
+ (tsconfigRootDir
61
+ ? Array.from(new Set([tsconfigRootDir, path.resolve(tsconfigRootDir, '../..')]))
62
+ : undefined);
63
+ const importExtraneousOptions = {
64
+ devDependencies: [
65
+ '**/*.test.{js,jsx,ts,tsx}',
66
+ '**/*.spec.{js,jsx,ts,tsx}',
67
+ '**/e2e/**/*.{js,jsx,ts,tsx}',
68
+ '**/{__tests__,__mocks__}/**/*',
69
+ '**/*.{config,conf}.{js,cjs,mjs,ts}',
70
+ '**/scripts/**/*.{js,cjs,mjs,ts}',
71
+ ],
72
+ peerDependencies: true,
73
+ optionalDependencies: false,
74
+ includeTypes: false,
75
+ };
76
+ if (resolvedPackageDirs && resolvedPackageDirs.length > 0) {
77
+ importExtraneousOptions.packageDir = resolvedPackageDirs;
78
+ }
79
+ const testingLibraryReact = testingLibrary.configs['flat/react'];
80
+ const config = [
81
+ // Ignore common build artifacts
82
+ { ignores },
83
+ // Surface accidental // eslint-disable comments
84
+ { linterOptions: { reportUnusedDisableDirectives: true } },
85
+ // Shared plugin registry (define once to avoid redefinition errors).
86
+ // eslint-plugin-import isn't flat-config-native yet, so it's wrapped with
87
+ // @eslint/compat's fixupPluginRules to avoid `context.getScope` crashes under ESLint 9+.
88
+ {
89
+ plugins: {
90
+ import: fixupPluginRules(importPlugin),
91
+ react: reactPlugin,
92
+ // react-hooks and @tanstack/eslint-plugin-query ship their own plugin types with
93
+ // minor structural mismatches (readonly rule option arrays, etc.) against ESLint's
94
+ // core Plugin type — cast through unknown rather than fighting type-only drift.
95
+ 'react-hooks': reactHooks,
96
+ 'jsx-a11y': a11y,
97
+ canonical,
98
+ jest,
99
+ '@typescript-eslint': tseslint.plugin,
100
+ '@tanstack/query': tanstackQuery,
101
+ },
102
+ },
103
+ // Base JS
104
+ js.configs.recommended,
105
+ // Disable stylistic rules that conflict with Prettier
106
+ prettier,
107
+ // Import hygiene, ordering, and resolution (JS/TS)
108
+ {
109
+ files: ['**/*.{js,jsx,ts,tsx}'],
110
+ settings: {
111
+ 'import/resolver': {
112
+ typescript: { project: tsProjects },
113
+ node: {
114
+ extensions: ['.js', '.jsx', '.ts', '.tsx', '.mjs', '.cjs', '.json'],
115
+ },
116
+ },
117
+ 'import/internal-regex': internalRegex,
118
+ },
119
+ rules: {
120
+ 'import/no-unresolved': [
121
+ 'error',
122
+ { commonjs: true, caseSensitive: true },
123
+ ],
124
+ 'import/no-extraneous-dependencies': ['error', importExtraneousOptions],
125
+ 'canonical/no-barrel-import': 'warn',
126
+ 'import/no-duplicates': 'error',
127
+ 'import/newline-after-import': 'error',
128
+ 'import/first': 'error',
129
+ '@typescript-eslint/consistent-type-imports': [
130
+ 'error',
131
+ { prefer: 'type-imports', fixStyle: 'separate-type-imports' },
132
+ ],
133
+ 'no-implicit-coercion': ['error', { boolean: true }],
134
+ eqeqeq: ['warn', 'always', { null: 'ignore' }],
135
+ 'no-undef': 'off',
136
+ },
137
+ },
138
+ // TanStack Query best practices
139
+ {
140
+ files: ['**/*.{js,jsx,ts,tsx}'],
141
+ rules: {
142
+ ...tanstackQuery.configs.recommended.rules,
143
+ },
144
+ },
145
+ // Declaration files: don't run import resolver/order rules on ambient types
146
+ {
147
+ files: ['**/*.d.ts'],
148
+ rules: {
149
+ 'import/no-duplicates': 'off',
150
+ 'import/order': 'off',
151
+ 'import/no-unresolved': 'off',
152
+ },
153
+ },
154
+ // Treat ESLint config files as Node (allow `process`, etc.)
155
+ {
156
+ files: ['eslint.config.{js,cjs,mjs}', '**/eslint.config.{js,cjs,mjs}'],
157
+ languageOptions: {
158
+ sourceType: 'module',
159
+ ecmaVersion: 'latest',
160
+ globals: globals.node,
161
+ },
162
+ },
163
+ // Treat .cjs files as CommonJS + Node globals (allow require/module.exports)
164
+ {
165
+ files: ['**/*.cjs'],
166
+ languageOptions: {
167
+ sourceType: 'commonjs',
168
+ ecmaVersion: 'latest',
169
+ globals: globals.node,
170
+ },
171
+ rules: {
172
+ '@typescript-eslint/no-require-imports': 'off',
173
+ },
174
+ },
175
+ // TypeScript
176
+ ...tseslint.configs.recommended,
177
+ // Type-aware TypeScript pass (enables rules that need type info)
178
+ {
179
+ files: ['**/*.{ts,tsx}'],
180
+ languageOptions: {
181
+ parser: tseslint.parser,
182
+ parserOptions: {
183
+ // Use projectService (TypeScript 5 project references) and avoid explicit `project`
184
+ // to prevent parser errors on files not directly listed in referenced tsconfigs.
185
+ project: undefined,
186
+ tsconfigRootDir,
187
+ projectService: true,
188
+ },
189
+ },
190
+ rules: {
191
+ '@typescript-eslint/prefer-optional-chain': 'warn',
192
+ '@typescript-eslint/prefer-nullish-coalescing': [
193
+ 'warn',
194
+ { ignoreMixedLogicalExpressions: false },
195
+ ],
196
+ '@typescript-eslint/no-unnecessary-condition': [
197
+ 'warn',
198
+ { allowConstantLoopConditions: true, checkTypePredicates: true },
199
+ ],
200
+ '@typescript-eslint/no-non-null-assertion': 'warn',
201
+ '@typescript-eslint/no-unnecessary-type-assertion': 'warn',
202
+ '@typescript-eslint/explicit-function-return-type': 'off',
203
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
204
+ '@typescript-eslint/no-empty-function': 'off',
205
+ },
206
+ },
207
+ // MD/MDX files themselves
208
+ {
209
+ ...mdx.flat,
210
+ files: ['**/*.md', '**/*.mdx'],
211
+ processor: mdx.createRemarkProcessor({
212
+ lintCodeBlocks: true,
213
+ ignoreRemarkConfig: false,
214
+ }),
215
+ },
216
+ // Virtual "code block" files extracted from MD/MDX
217
+ {
218
+ ...mdx.flatCodeBlocks,
219
+ rules: {
220
+ ...mdx.flatCodeBlocks.rules,
221
+ 'no-var': 'error',
222
+ 'prefer-const': 'error',
223
+ },
224
+ },
225
+ // Jest unit tests
226
+ {
227
+ files: [
228
+ '**/__tests__/**/*.{js,jsx,ts,tsx}',
229
+ '**/*.{test,spec}.{js,jsx,ts,tsx}',
230
+ ],
231
+ ...jest.configs['flat/recommended'],
232
+ languageOptions: {
233
+ ecmaVersion: 'latest',
234
+ sourceType: 'module',
235
+ globals: { ...globals.node, ...jest.environments.globals.globals },
236
+ },
237
+ rules: {
238
+ ...jest.configs['flat/recommended'].rules,
239
+ '@typescript-eslint/no-explicit-any': 'off',
240
+ '@typescript-eslint/no-non-null-assertion': 'off',
241
+ '@typescript-eslint/no-unused-vars': 'off',
242
+ '@typescript-eslint/no-require-imports': 'off',
243
+ '@typescript-eslint/consistent-type-imports': 'off',
244
+ '@typescript-eslint/no-unnecessary-condition': 'off',
245
+ 'no-console': 'off',
246
+ 'no-useless-escape': 'off',
247
+ },
248
+ },
249
+ // Testing Library best practices for component tests
250
+ {
251
+ ...testingLibraryReact,
252
+ files: ['**/__tests__/**/*.{jsx,tsx}', '**/*.{test,spec}.{jsx,tsx}'],
253
+ },
254
+ // E2E: Playwright tests
255
+ {
256
+ files: ['**/e2e/**/*.{js,jsx,ts,tsx}', '**/*.e2e.{js,jsx,ts,tsx}'],
257
+ languageOptions: {
258
+ ecmaVersion: 'latest',
259
+ sourceType: 'module',
260
+ globals: {
261
+ ...globals.node,
262
+ page: 'readonly',
263
+ browser: 'readonly',
264
+ context: 'readonly',
265
+ test: 'readonly',
266
+ expect: 'readonly',
267
+ },
268
+ },
269
+ },
270
+ ];
271
+ if (!react) {
272
+ return config;
273
+ }
274
+ return [
275
+ ...config,
276
+ // React + React Hooks
277
+ {
278
+ files: ['**/*.{js,jsx,ts,tsx}'],
279
+ rules: {
280
+ ...reactPlugin.configs.recommended.rules,
281
+ ...reactPlugin.configs['jsx-runtime'].rules,
282
+ 'react-hooks/rules-of-hooks': 'error',
283
+ 'react-hooks/exhaustive-deps': 'error',
284
+ 'react/display-name': 'off',
285
+ },
286
+ settings: {
287
+ react: { version: 'detect' },
288
+ },
289
+ },
290
+ // Accessibility linting for React components
291
+ {
292
+ files: ['**/*.{jsx,tsx}'],
293
+ rules: {
294
+ ...a11y.configs.recommended.rules,
295
+ },
296
+ },
297
+ ];
298
+ };
299
+ export default createConfig;
300
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,aAAa,MAAM,+BAA+B,CAAA;AAEzD,OAAO,QAAQ,MAAM,wBAAwB,CAAA;AAC7C,OAAO,SAAS,MAAM,yBAAyB,CAAA;AAC/C,OAAO,YAAY,MAAM,sBAAsB,CAAA;AAC/C,OAAO,IAAI,MAAM,oBAAoB,CAAA;AACrC,OAAO,IAAI,MAAM,wBAAwB,CAAA;AACzC,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAA;AACxC,OAAO,WAAW,MAAM,qBAAqB,CAAA;AAC7C,OAAO,UAAU,MAAM,2BAA2B,CAAA;AAClD,OAAO,cAAc,MAAM,+BAA+B,CAAA;AAC1D,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAE7C;;;;;;;;;;;;GAYG;AAEH,MAAM,eAAe,GAAG;IACtB,oBAAoB;IACpB,MAAM;IACN,YAAY;IACZ,wBAAwB;IACxB,SAAS;IACT,QAAQ;IACR,UAAU;IACV,OAAO;IACP,UAAU;IACV,KAAK;IACL,QAAQ;IACR,WAAW;IACX,aAAa;IACb,YAAY;IACZ,cAAc;IACd,UAAU;IACV,YAAY;IACZ,mBAAmB;IACnB,oBAAoB;IACpB,oBAAoB;IACpB,gBAAgB;IAChB,kBAAkB;IAClB,kBAAkB;IAClB,wBAAwB;CACzB,CAAA;AAED,MAAM,mBAAmB,GAAG,CAAC,iBAAiB,CAAC,CAAA;AAC/C,MAAM,sBAAsB,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,4BAA4B,CAAC;SACrE;QAED,wBAAwB;QACxB;YACE,KAAK,EAAE,CAAC,6BAA6B,EAAE,0BAA0B,CAAC;YAClE,eAAe,EAAE;gBACf,WAAW,EAAE,QAAQ;gBACrB,UAAU,EAAE,QAAQ;gBACpB,OAAO,EAAE;oBACP,GAAG,OAAO,CAAC,IAAI;oBACf,IAAI,EAAE,UAAU;oBAChB,OAAO,EAAE,UAAU;oBACnB,OAAO,EAAE,UAAU;oBACnB,IAAI,EAAE,UAAU;oBAChB,MAAM,EAAE,UAAU;iBACnB;aACF;SACF;KACF,CAAA;IAED,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,MAAM,CAAA;IACf,CAAC;IAED,OAAO;QACL,GAAG,MAAM;QAET,sBAAsB;QACtB;YACE,KAAK,EAAE,CAAC,sBAAsB,CAAC;YAC/B,KAAK,EAAE;gBACL,GAAG,WAAW,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK;gBACxC,GAAG,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,KAAK;gBAC3C,4BAA4B,EAAE,OAAO;gBACrC,6BAA6B,EAAE,OAAO;gBACtC,oBAAoB,EAAE,KAAK;aAC5B;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;aAC7B;SACF;QAED,6CAA6C;QAC7C;YACE,KAAK,EAAE,CAAC,gBAAgB,CAAC;YACzB,KAAK,EAAE;gBACL,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK;aAClC;SACF;KACF,CAAA;AACH,CAAC,CAAA;AAED,eAAe,YAAY,CAAA"}
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@cogs/eslint-config",
3
+ "version": "0.1.0",
4
+ "description": "Shared flat ESLint configuration for the catesworks fleet",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/catesworks/cogs.git",
9
+ "directory": "packages/eslint-config"
10
+ },
11
+ "type": "module",
12
+ "main": "./dist/index.js",
13
+ "types": "./dist/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.js"
18
+ },
19
+ "./*": {
20
+ "types": "./dist/*.d.ts",
21
+ "import": "./dist/*.js"
22
+ },
23
+ "./package.json": "./package.json"
24
+ },
25
+ "files": [
26
+ "dist",
27
+ "!dist/*.tsbuildinfo"
28
+ ],
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "peerDependencies": {
33
+ "eslint": "^9.0.0"
34
+ },
35
+ "devDependencies": {
36
+ "@types/eslint-plugin-jsx-a11y": "^6.10.1",
37
+ "eslint": "^9.0.0",
38
+ "vitest": "^3.0.0"
39
+ },
40
+ "dependencies": {
41
+ "@eslint/compat": "^2.1.1",
42
+ "@eslint/js": "^9.39.5",
43
+ "@tanstack/eslint-plugin-query": "^5.102.8",
44
+ "eslint-config-prettier": "^10.1.8",
45
+ "eslint-import-resolver-typescript": "^4.4.5",
46
+ "eslint-plugin-canonical": "^5.1.3",
47
+ "eslint-plugin-import": "^2.32.0",
48
+ "eslint-plugin-jest": "^29.16.6",
49
+ "eslint-plugin-jsx-a11y": "^6.10.2",
50
+ "eslint-plugin-mdx": "^3.8.1",
51
+ "eslint-plugin-react": "^7.37.5",
52
+ "eslint-plugin-react-hooks": "^7.1.1",
53
+ "eslint-plugin-testing-library": "^7.16.2",
54
+ "globals": "^17.12.0",
55
+ "typescript-eslint": "^8.70.0"
56
+ },
57
+ "scripts": {
58
+ "build": "tsc -p tsconfig.json",
59
+ "lint": "biome check .",
60
+ "typecheck": "tsc -p tsconfig.json --noEmit",
61
+ "test": "vitest run"
62
+ }
63
+ }