@t4h.framework/eslint-config 0.1.0 → 0.2.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @t4h.framework/eslint-config
2
2
 
3
+ ## 0.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#276](https://github.com/tech4humans-brasil/framework/pull/276) [`7b38934`](https://github.com/tech4humans-brasil/framework/commit/7b38934e8f9207c98c33afcd76e3a7a4da7e8b14) Thanks [@gusteycamargo](https://github.com/gusteycamargo)! - The docs give all the rules of the base config, the import order, the 14 Prettier options and the version ranges of the peers. The Portuguese docs are new.
8
+
9
+ ## 0.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#274](https://github.com/tech4humans-brasil/framework/pull/274) [`7d7d4ec`](https://github.com/tech4humans-brasil/framework/commit/7d7d4ec27e55262f3f0353a7253a95e12d24de9b) Thanks [@gusteycamargo](https://github.com/gusteycamargo)! - Replaces `defineConfig()` with `framework(options, ...configs)`. The configs of the user come last, so their rules win over the base config and the package configs. The `jsx` option turns the React rules on or off. When it is not set, the JSX config applies only if an installed package declares `requires: { jsx: true }` in its `eslint` entry. The fixed list with `@t4h.framework/pdf` is gone, so JSX turns on only with a `pdf` version that has the `./eslint` entry, or with `jsx: true`. The packages are found with `local-pkg`, so Yarn PnP and pnpm work. A `@t4h.framework/*` package that is in `package.json` but not installed now causes an error, and so does an `eslint` entry that is declared but does not load. `framework()` uses the nearest `package.json` at or above `cwd`. `cspell/spellchecker` is now a warning. `no-comments` has a docs URL and no longer accepts a comment that only starts with the word `eslint`.
14
+
3
15
  ## 0.1.0
4
16
 
5
17
  ### Minor Changes
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Tech for humans
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -3,13 +3,26 @@
3
3
  ESLint and Prettier configuration for the T4H Framework. It also turns on the
4
4
  rules of each `@t4h.framework/*` package that the project uses.
5
5
 
6
+ ## Installation
7
+
8
+ ```bash
9
+ yarn add --dev @t4h.framework/eslint-config eslint prettier typescript
10
+ ```
11
+
6
12
  ## Usage
7
13
 
8
14
  ```javascript
9
15
  // eslint.config.mjs
10
- import { defineConfig } from '@t4h.framework/eslint-config'
16
+ import { framework } from '@t4h.framework/eslint-config'
11
17
 
12
- export default defineConfig()
18
+ export default framework()
19
+ ```
20
+
21
+ To add or change rules, put your configs after the options. They come last,
22
+ so they win:
23
+
24
+ ```javascript
25
+ export default framework({}, { rules: { 'max-depth': ['error', 3] } })
13
26
  ```
14
27
 
15
28
  ```json
@@ -18,10 +31,16 @@ export default defineConfig()
18
31
  }
19
32
  ```
20
33
 
21
- | Entry | What it has |
22
- | ----------------------------------------------- | --------------------------------------------------------- |
23
- | `@t4h.framework/eslint-config` | The base config (default export) and `defineConfig()` |
24
- | `@t4h.framework/eslint-config/jsx` | The base config and the React rules for `.jsx` and `.tsx` |
34
+ | Entry | What it has |
35
+ | ---------------------------------------------- | --------------------------------------------------------- |
36
+ | `@t4h.framework/eslint-config` | The base config (default export) and `framework()` |
37
+ | `@t4h.framework/eslint-config/jsx` | The base config and the React rules for `.jsx` and `.tsx` |
25
38
  | `@t4h.framework/eslint-config/prettier-config` | The Prettier options |
26
39
 
27
- Peer dependencies: `eslint`, `prettier` and `typescript`.
40
+ Peer dependencies: `eslint` `>=10`, `prettier` `>=3` and `typescript`
41
+ `>=5.0.0 <6.0.0`. The package needs Node.js >= 22.
42
+
43
+ To see the rules that apply to each file, run `npx @eslint/config-inspector`.
44
+
45
+ Read the full documentation on the
46
+ [docs site](https://tech4humans-brasil.github.io/framework/eslint-config/).
@@ -83,7 +83,7 @@ export const base = [
83
83
  'no-lonely-if': 'error',
84
84
  'no-else-return': ['error', { allowElseIf: false }],
85
85
  'sonarjs/cognitive-complexity': ['error', 15],
86
- 'cspell/spellchecker': 'error',
86
+ 'cspell/spellchecker': 'warn',
87
87
  },
88
88
  },
89
89
  ...typed,
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/configs/base.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,uBAAuB,CAAA;AAC1C,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,QAAQ,MAAM,yDAAyD,CAAA;AAC9E,OAAO,MAAM,MAAM,uBAAuB,CAAA;AAE1C,OAAO,EAAE,8BAA8B,EAAE,MAAM,mCAAmC,CAAA;AAClF,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,CAAC,MAAM,iBAAiB,CAAA;AAC/B,OAAO,QAAQ,MAAM,oCAAoC,CAAA;AACzD,OAAO,OAAO,MAAM,uBAAuB,CAAA;AAC3C,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAElC,OAAO,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EAAE,CAAC,SAAS,CAAC;oBAC1C,WAAW,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE;oBACpD,kBAAkB,EAAE,QAAQ;iBAC7B;aACF;YACD,WAAW,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;YACzB,mBAAmB,EAAE,OAAO;YAC5B,cAAc,EAAE,OAAO;YACvB,gBAAgB,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;YACnD,8BAA8B,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;YAC7C,qBAAqB,EAAE,MAAM;SAC9B;KACF;IACD,GAAG,KAAK;IACR;QACE,KAAK,EAAE,WAAW;QAClB,eAAe,EAAE;YACf,aAAa,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE;SACxC;QACD,KAAK,EAAE;YACL,kCAAkC,EAAE,KAAK;YACzC,iCAAiC,EAAE,KAAK;YACxC,kDAAkD,EAAE,KAAK;YACzD,gDAAgD,EAAE,OAAO;YACzD,mCAAmC,EAAE;gBACnC,OAAO;gBACP,EAAE,iBAAiB,EAAE,wBAAwB,EAAE;aAChD;SACF;KACF;IACD;QACE,KAAK,EAAE,UAAU;QACjB,OAAO,EAAE,EAAE,MAAM,EAAE;QACnB,KAAK,EAAE;YACL,yBAAyB,EAAE,OAAO;YAClC,0BAA0B,EAAE,OAAO;YACnC,sBAAsB,EAAE;gBACtB,OAAO;gBACP,EAAE,mBAAmB,EAAE,CAAC,QAAQ,EAAE,cAAc,EAAE,YAAY,CAAC,EAAE;aAClE;YACD,2BAA2B,EAAE,OAAO;YACpC,qBAAqB,EAAE,OAAO;SAC/B;KACF;IACD;QACE,KAAK,EAAE,CAAC,oBAAoB,CAAC;QAC7B,KAAK,EAAE,EAAE,qBAAqB,EAAE,KAAK,EAAE;KACxC;CACF,CAAA"}
@@ -1,4 +1,4 @@
1
1
  import { base } from './configs/base.js';
2
- export * from './tools/defineConfig.js';
2
+ export * from './tools/framework.js';
3
3
  export default base;
4
4
  //# sourceMappingURL=eslint-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"eslint-config.d.ts","sourceRoot":"","sources":["../src/eslint-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAExC,cAAc,yBAAyB,CAAA;AAEvC,eAAe,IAAI,CAAA"}
1
+ {"version":3,"file":"eslint-config.d.ts","sourceRoot":"","sources":["../src/eslint-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAExC,cAAc,sBAAsB,CAAA;AAEpC,eAAe,IAAI,CAAA"}
@@ -1,4 +1,4 @@
1
1
  import { base } from './configs/base.js';
2
- export * from './tools/defineConfig.js';
2
+ export * from './tools/framework.js';
3
3
  export default base;
4
4
  //# sourceMappingURL=eslint-config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"eslint-config.js","sourceRoot":"","sources":["../src/eslint-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAExC,cAAc,yBAAyB,CAAA;AAEvC,eAAe,IAAI,CAAA"}
1
+ {"version":3,"file":"eslint-config.js","sourceRoot":"","sources":["../src/eslint-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAExC,cAAc,sBAAsB,CAAA;AAEpC,eAAe,IAAI,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"no-comments.d.ts","sourceRoot":"","sources":["../../src/rules/no-comments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAO,IAAI,EAAc,MAAM,QAAQ,CAAA;AAiDnD,eAAO,MAAM,UAAU,EAAE,IAAI,CAAC,UA6B7B,CAAA"}
1
+ {"version":3,"file":"no-comments.d.ts","sourceRoot":"","sources":["../../src/rules/no-comments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAO,IAAI,EAAc,MAAM,QAAQ,CAAA;AAoDnD,eAAO,MAAM,UAAU,EAAE,IAAI,CAAC,UA8B7B,CAAA"}
@@ -1,4 +1,5 @@
1
- const DIRECTIVE = /^\s*(eslint|global\s|@ts-|prettier-ignore|cspell:|v8 ignore|istanbul ignore)/;
1
+ const DIRECTIVE = /^\s*(eslint-(disable|enable)\b|eslint\s+[\w@/-]+\s*:|global\s|@ts-|prettier-ignore|cspell:|v8 ignore|istanbul ignore)/;
2
+ const DOCS_URL = 'https://tech4humans-brasil.github.io/framework/eslint-config/rules/no-comments';
2
3
  const EXPORT_TYPES = new Set([
3
4
  'ExportNamedDeclaration',
4
5
  'ExportDefaultDeclaration',
@@ -39,6 +40,7 @@ export const noComments = {
39
40
  type: 'suggestion',
40
41
  docs: {
41
42
  description: 'Allows only directives and JSDoc on exported declarations',
43
+ url: DOCS_URL,
42
44
  },
43
45
  messages: {
44
46
  comment: 'Comments are not allowed. Make the code explain itself, or use JSDoc on an exported declaration. If a comment is really necessary, disable this rule on that line and give the reason after "--".',
@@ -1 +1 @@
1
- {"version":3,"file":"no-comments.js","sourceRoot":"","sources":["../../src/rules/no-comments.ts"],"names":[],"mappings":"AAIA,MAAM,SAAS,GACb,8EAA8E,CAAA;AAEhF,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,wBAAwB;IACxB,0BAA0B;CAC3B,CAAC,CAAA;AAEF,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;IACzB,gBAAgB;IAChB,aAAa;IACb,yBAAyB;IACzB,oBAAoB;CACrB,CAAC,CAAA;AAEF,SAAS,WAAW,CAAC,OAAgB;IACnC,IAAK,OAAO,CAAC,IAAe,KAAK,SAAS;QAAE,OAAO,IAAI,CAAA;IACvD,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,IAAI,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC;QACrE,OAAO,IAAI,CAAA;IAEb,OAAO,SAAS,CAAC,IAAI,CAA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4
+ */
5
+ export interface FrameworkOptions {
6
+ /**
7
+ * The folder where the search for the project `package.json` starts. The
8
+ * nearest `package.json` at or above it is used. Defaults to `process.cwd()`.
9
+ */
10
+ cwd?: string;
11
+ /**
12
+ * Turns the React rules for `.jsx` and `.tsx` on or off. Defaults to `true`
13
+ * when an installed `@t4h.framework/*` package requires JSX.
14
+ */
15
+ jsx?: boolean;
16
+ }
17
+ /**
18
+ * Builds the ESLint config of a project. It starts from the base config, or
19
+ * the JSX config when JSX is on, then appends the `recommended` config of each
20
+ * installed `@t4h.framework/*` package that has an `eslint` entry, and then the
21
+ * configs of the user.
22
+ */
23
+ export declare function framework(options?: FrameworkOptions, ...userConfigs: (Linter.Config | Linter.Config[])[]): Promise<Linter.Config[]>;
24
+ //# sourceMappingURL=framework.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framework.d.ts","sourceRoot":"","sources":["../../src/tools/framework.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAoBpC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;CACd;AA6CD;;;;;GAKG;AACH,wBAAsB,SAAS,CAC7B,OAAO,GAAE,gBAAqB,EAC9B,GAAG,WAAW,EAAE,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,GAClD,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAgB1B"}
@@ -0,0 +1,60 @@
1
+ import { pathToFileURL } from 'node:url';
2
+ import { getPackageInfo, importModule, loadPackageJSON, resolveModule, } from 'local-pkg';
3
+ import { base } from '../configs/base.js';
4
+ import { jsx } from '../configs/jsx.js';
5
+ const SCOPE = '@t4h.framework/';
6
+ const ESLINT_ENTRY = './eslint';
7
+ async function readFrameworkDependencies(cwd) {
8
+ const packageJson = await loadPackageJSON(cwd);
9
+ const names = Object.keys({
10
+ ...packageJson?.dependencies,
11
+ ...packageJson?.devDependencies,
12
+ });
13
+ return names.filter(name => name.startsWith(SCOPE)).sort();
14
+ }
15
+ function isPackageEslintEntry(value) {
16
+ if (typeof value !== 'object' || value === null)
17
+ return false;
18
+ if (!('configs' in value))
19
+ return false;
20
+ const { configs } = value;
21
+ if (typeof configs !== 'object' || configs === null)
22
+ return false;
23
+ return Array.isArray(configs.recommended);
24
+ }
25
+ async function loadPackageEntry(cwd, name) {
26
+ const paths = [cwd];
27
+ const info = await getPackageInfo(name, { paths });
28
+ if (!info)
29
+ throw new Error(`${name} is in package.json but is not installed. Install the dependencies of the project.`);
30
+ const exports = info.packageJson.exports;
31
+ if (!exports?.[ESLINT_ENTRY])
32
+ return undefined;
33
+ const file = resolveModule(`${name}/eslint`, { paths });
34
+ if (!file)
35
+ throw new Error(`${name}/eslint is declared but does not resolve`);
36
+ const entry = await importModule(pathToFileURL(file).href);
37
+ if (!isPackageEslintEntry(entry))
38
+ throw new Error(`${name}/eslint does not export configs.recommended`);
39
+ return entry;
40
+ }
41
+ /**
42
+ * Builds the ESLint config of a project. It starts from the base config, or
43
+ * the JSX config when JSX is on, then appends the `recommended` config of each
44
+ * installed `@t4h.framework/*` package that has an `eslint` entry, and then the
45
+ * configs of the user.
46
+ */
47
+ export async function framework(options = {}, ...userConfigs) {
48
+ const cwd = options.cwd ?? process.cwd();
49
+ const names = await readFrameworkDependencies(cwd);
50
+ const results = await Promise.all(names.map(name => loadPackageEntry(cwd, name)));
51
+ const eslintEntries = results.filter(entry => entry !== undefined);
52
+ const isJsx = options.jsx ?? eslintEntries.some(entry => entry.requires?.jsx === true);
53
+ return [
54
+ ...(isJsx ? jsx : base),
55
+ { languageOptions: { parserOptions: { tsconfigRootDir: cwd } } },
56
+ ...eslintEntries.flatMap(entry => entry.configs.recommended),
57
+ ...userConfigs.flat(),
58
+ ];
59
+ }
60
+ //# sourceMapp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AAK,KAAK,SAAS,CAAC,CAAA;IAClE,MAAM,KAAK,GACT,OAAO,CAAC,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC,CAAA;IAE1E,OAAO;QACL,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;QACvB,EAAE,eAAe,EAAE,EAAE,aAAa,EAAE,EAAE,eAAe,EAAE,GAAG,EAAE,EAAE,EAAE;QAChE,GAAG,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC;QAC5D,GAAG,WAAW,CAAC,IAAI,EAAE;KACtB,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t4h.framework/eslint-config",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "ESLint and Prettier configuration for the T4H Framework",
5
5
  "homepage": "https://github.com/tech4humans-brasil/framework/tree/main/packages/eslint-config",
6
6
  "bugs": "https://github.com/tech4humans-brasil/framework/issues",
@@ -54,6 +54,7 @@
54
54
  "eslint-plugin-react": "^7.37.5",
55
55
  "eslint-plugin-sonarjs": "^4.2.2",
56
56
  "globals": "^15.15.0",
57
+ "local-pkg": "^1.2.1",
57
58
  "typescript-eslint": "^8.55.0"
58
59
  },
59
60
  "devDependencies": {
@@ -1,18 +0,0 @@
1
- import type { Linter } from 'eslint';
2
- /**
3
- * Options of {@link defineConfig}.
4
- */
5
- export interface DefineConfigOptions {
6
- /**
7
- * The folder of the project `package.json`. Defaults to `process.cwd()`.
8
- */
9
- cwd?: string;
10
- }
11
- /**
12
- * Builds the ESLint config of a project. It starts from the base config, or
13
- * the JSX config when a package with JSX templates is installed, and appends
14
- * the `recommended` config of each installed `@t4h.framework/*` package that
15
- * has an `eslint` entry.
16
- */
17
- export declare function defineConfig(options?: DefineConfigOptions): Promise<Linter.Config[]>;
18
- //# sourceMappingURL=defineConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"defineConfig.d.ts","sourceRoot":"","sources":["../../src/tools/defineConfig.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAuBpC;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAqED;;;;;GAKG;AACH,wBAAsB,YAAY,CAChC,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAa1B"}
@@ -1,84 +0,0 @@
1
- import fs from 'node:fs/promises';
2
- import path from 'node:path';
3
- import { pathToFileURL } from 'node:url';
4
- import { base } from '../configs/base.js';
5
- import { jsx } from '../configs/jsx.js';
6
- const SCOPE = '@t4h.framework/';
7
- const ESLINT_ENTRY = './eslint';
8
- const JSX_PACKAGES = new Set(['@t4h.framework/pdf']);
9
- async function readPackageJson(directory) {
10
- try {
11
- const content = await fs.readFile(path.join(directory, 'package.json'), 'utf8');
12
- return JSON.parse(content);
13
- }
14
- catch (error) {
15
- if (error.code === 'ENOENT')
16
- return undefined;
17
- throw error;
18
- }
19
- }
20
- async function readFrameworkDependencies(cwd) {
21
- const packageJson = await readPackageJson(cwd);
22
- const names = Object.keys({
23
- ...packageJson?.dependencies,
24
- ...packageJson?.devDependencies,
25
- });
26
- return names.filter(name => name.startsWith(SCOPE)).sort();
27
- }
28
- async function findInstalledPackage(cwd, name) {
29
- for (let directory = cwd;; directory = path.dirname(directory)) {
30
- const packageDirectory = path.join(directory, 'node_modules', name);
31
- const packageJson = await readPackageJson(packageDirectory);
32
- if (packageJson)
33
- return { packageDirectory, packageJson };
34
- if (path.dirname(directory) === directory)
35
- return undefined;
36
- }
37
- }
38
- function toImportPath(target) {
39
- if (typeof target === 'string')
40
- return target;
41
- const file = target?.import ?? target?.default;
42
- return typeof file === 'string' ? file : undefined;
43
- }
44
- function isPackageEslintEntry(value) {
45
- if (typeof value !== 'object' || value === null)
46
- return false;
47
- if (!('configs' in value))
48
- return false;
49
- const { configs } = value;
50
- if (typeof configs !== 'object' || configs === null)
51
- return false;
52
- return Array.isArray(configs.recommended);
53
- }
54
- async function loadPackageConfig(cwd, name) {
55
- const installed = await findInstalledPackage(cwd, name);
56
- if (!installed)
57
- return [];
58
- const file = toImportPath(installed.packageJson.exports?.[ESLINT_ENTRY]);
59
- if (!file)
60
- return [];
61
- const url = pathToFileURL(path.join(installed.packageDirectory, file));
62
- const module = (await import(url.href));
63
- if (!isPackageEslintEntry(module.default))
64
- throw new Error(`${name}/eslint does not export configs.recommended`);
65
- return module.default.configs.recommended;
66
- }
67
- /**
68
- * Builds the ESLint config of a project. It starts from the base config, or
69
- * the JSX config when a package with JSX templates is installed, and appends
70
- * the `recommended` config of each installed `@t4h.framework/*` package that
71
- * has an `eslint` entry.
72
- */
73
- export async function defineConfig(options = {}) {
74
- const cwd = options.cwd ?? process.cwd();
75
- const names = await readFrameworkDependencies(cwd);
76
- const packageConfigs = await Promise.all(names.map(name => loadPackageConfig(cwd, name)));
77
- const root = names.some(name => JSX_PACKAGES.has(name)) ? jsx : base;
78
- return [
79
- ...root,
80
- { languageOptions: { parserOptions: { tsconfigRootDir: cwd } } },
81
- ...packageConfigs.flat(),
82
- ];
83
- }
84
- //# sourceMappingURL=defineConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"defineConfig.js","sourceRoot":"","sources":["../../src/tools/defineConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACjC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAIxC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAm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