@matrixai/lint 0.2.12 → 0.4.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.
Files changed (47) hide show
  1. package/AGENTS.md +23 -0
  2. package/README.md +151 -83
  3. package/dist/bin/matrixai-lint.js +174 -0
  4. package/dist/bin/matrixai-lint.js.map +1 -0
  5. package/dist/config.d.ts +15 -0
  6. package/dist/config.js +120 -0
  7. package/dist/config.js.map +1 -0
  8. package/dist/configs/{js.js → eslint.js} +5 -4
  9. package/dist/configs/eslint.js.map +1 -0
  10. package/dist/configs/{prettier.config.mjs → prettier.config.js} +1 -1
  11. package/dist/configs/prettier.config.js.map +1 -0
  12. package/dist/domains/engine.d.ts +72 -0
  13. package/dist/domains/engine.js +160 -0
  14. package/dist/domains/engine.js.map +1 -0
  15. package/dist/domains/eslint.d.ts +3 -0
  16. package/dist/domains/eslint.js +72 -0
  17. package/dist/domains/eslint.js.map +1 -0
  18. package/dist/domains/files.d.ts +4 -0
  19. package/dist/domains/files.js +95 -0
  20. package/dist/domains/files.js.map +1 -0
  21. package/dist/domains/index.d.ts +14 -0
  22. package/dist/domains/index.js +83 -0
  23. package/dist/domains/index.js.map +1 -0
  24. package/dist/domains/markdown.d.ts +5 -0
  25. package/dist/domains/markdown.js +103 -0
  26. package/dist/domains/markdown.js.map +1 -0
  27. package/dist/domains/shell.d.ts +5 -0
  28. package/dist/domains/shell.js +58 -0
  29. package/dist/domains/shell.js.map +1 -0
  30. package/dist/index.d.ts +2 -0
  31. package/dist/index.js +2 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/tsbuildinfo +1 -0
  34. package/dist/types.d.ts +31 -8
  35. package/dist/utils.d.ts +13 -18
  36. package/dist/utils.js +207 -94
  37. package/dist/utils.js.map +1 -1
  38. package/package.json +23 -13
  39. package/dist/bin/lint.js +0 -182
  40. package/dist/bin/lint.js.map +0 -1
  41. package/dist/configs/js.js.map +0 -1
  42. package/dist/configs/prettier.config.mjs.map +0 -1
  43. package/flake.lock +0 -78
  44. package/jest.config.mjs +0 -84
  45. /package/dist/bin/{lint.d.ts → matrixai-lint.d.ts} +0 -0
  46. /package/dist/configs/{js.d.ts → eslint.d.ts} +0 -0
  47. /package/dist/configs/{prettier.config.d.mts → prettier.config.d.ts} +0 -0
package/AGENTS.md ADDED
@@ -0,0 +1,23 @@
1
+ # AGENTS
2
+ - Read the repo profile selector at [`.matrixai/repo-profile.yml`](.matrixai/repo-profile.yml).
3
+ - Enforce the universal hotset [`.matrixai/matrixai-standards/standards/HOTSET.md`](.matrixai/matrixai-standards/standards/HOTSET.md).
4
+ - Enforce the profile doc under [`.matrixai/matrixai-standards/standards/profiles/`](.matrixai/matrixai-standards/standards/profiles) matching `profile:` in `.matrixai/repo-profile.yml` (e.g., `library-js`, `application-js`, `worker-js-cloudflare`, `docusaurus-js-cloudflare`).
5
+ - Profile index (for discovery): [`.matrixai/matrixai-standards/standards/profiles/README.md`](.matrixai/matrixai-standards/standards/profiles/README.md)
6
+ - Tooling contract reference: [`.matrixai/matrixai-standards/standards/coding/tooling/tooling-contract.md`](.matrixai/matrixai-standards/standards/coding/tooling/tooling-contract.md) (commands, artifacts, expectations per profile).
7
+ - Prefer ASCII punctuation/symbols when an equivalent exists (see [`.matrixai/matrixai-standards/standards/HOTSET.md`](.matrixai/matrixai-standards/standards/HOTSET.md) [MXS-GEN-006]).
8
+ - Ensure edits comply with [`.editorconfig`](.editorconfig) (LF line endings, 2-space indent, final newline, trim trailing whitespace).
9
+ - Line-reference policy (applies to all agent-generated repository content: Markdown, docs, templates, and code comments):
10
+ - Never emit `path:line` (e.g. `foo.ts:1`, `README.md:126`) into repository files.
11
+ - Do NOT put `:number` inside Markdown link destinations: `[x](path:123)` is banned.
12
+ - If a line reference is needed, use either:
13
+ - `[x](path#heading-anchor)` (if possible), or
14
+ - `[x](path) (line 123)` (preferred, portable), or
15
+ - `[x](path#L123)` only when explicitly targeting a renderer that supports `#L` anchors.
16
+ - If you would have emitted `:1`, drop it entirely: use `path` with no line info.
17
+ - Apply repo-local golden commands and overrides here (use `npm run lintfix` during active development; use `npm run lint` for non-mutating CI checks):
18
+ - build: npm run build
19
+ - test: npm test
20
+ - lintfix: npm run lintfix
21
+ - lint: npm run lint
22
+ - docs: npm run docs
23
+ - bench: (not defined in this repo)
package/README.md CHANGED
@@ -21,11 +21,13 @@ npm install --save-dev @matrixai/lint
21
21
 
22
22
  ## Usage
23
23
 
24
+ ### CLI
25
+
24
26
  ```sh
25
27
  matrixai-lint
26
28
  ```
27
29
 
28
- To run with autofix:
30
+ With autofix:
29
31
 
30
32
  ```sh
31
33
  matrixai-lint --fix
@@ -33,120 +35,186 @@ matrixai-lint --fix
33
35
 
34
36
  ### CLI Options
35
37
 
36
- | Flag | Description |
37
- | ----------------- | ---------------------------------------------------------------------------- |
38
- | _(no flag)_ | Uses built-in Matrix AI ESLint config |
39
- | `--fix` | Enables auto-fixing via ESLint and Prettier |
40
- | `--user-config` | Uses detected \`eslint.config.[js,mjs,cjs,ts] from the project root if found |
41
- | `--config <path>` | Explicitly use a custom ESLint config file |
42
-
43
- ### Examples
38
+ | Flag | Description |
39
+ | ------------------------ | ---------------------------------------------------------------------------- |
40
+ | _(no flag)_ | Uses built-in Matrix AI ESLint config |
41
+ | `--fix` | Enables auto-fixing via ESLint and Prettier |
42
+ | `--user-config` | Uses detected `eslint.config.[js,mjs,cjs,ts]` from the project root if found |
43
+ | `--eslint-config <path>` | Explicitly use a custom ESLint config file |
44
+ | `--eslint <targets>` | ESLint targets (files, roots, or globs); implies ESLint domain selection |
45
+ | `--markdown <targets>` | Markdown targets (files, roots, or globs); implies markdown domain selection |
46
+ | `--shell <targets>` | Shell targets (files, roots, or globs); implies shell domain selection |
47
+ | `--domain <id...>` | Run only selected domains (`eslint`, `shell`, `markdown`) |
48
+ | `--skip-domain <id...>` | Skip selected domains (`eslint`, `shell`, `markdown`) |
49
+ | `--list-domains` | Print available domains and short descriptions, then exit 0 |
50
+ | `--explain` | Print per-domain decision details before execution |
51
+ | `-v, --verbose` | Increase log verbosity (repeat for more detail) |
52
+
53
+ Domain selection behavior:
54
+
55
+ - With no selectors and no domain-specific target flags, all built-in domains
56
+ run by default.
57
+ - Passing `--eslint` and/or `--shell` implies explicit domain selection from
58
+ those flags.
59
+ - `--eslint ...` runs ESLint only.
60
+ - `--shell ...` runs shell only.
61
+ - Passing both runs both.
62
+ - Passing `--markdown` implies markdown domain selection.
63
+ - `--markdown ...` runs markdown only.
64
+ - Combined with other target flags, only those targeted domains run.
65
+ - `shellcheck` is optional only for default auto-run shell execution.
66
+ - If shell is explicitly requested (`--shell ...` or `--domain shell`),
67
+ missing `shellcheck` is a failure.
68
+ - `--shell` accepts target paths and glob patterns.
69
+ - Directories are used as roots.
70
+ - File paths and glob patterns are reduced to search roots, then `*.sh` files
71
+ are discovered under those roots.
72
+ - `--markdown` accepts target paths and glob patterns.
73
+ - Directories are used as roots.
74
+ - File paths and glob patterns are reduced to search roots, then `*.md` /
75
+ `*.mdx` files are discovered under those roots.
76
+
77
+ #### Targeted workflows
78
+
79
+ - Only ESLint on a subset of files:
80
+
81
+ ```sh
82
+ matrixai-lint --eslint "src/**/*.{ts,tsx}" --domain eslint
83
+ ```
84
+
85
+ - Only shell scripts under specific roots:
86
+
87
+ ```sh
88
+ matrixai-lint --shell scripts packages/*/scripts
89
+ ```
90
+
91
+ - Markdown only:
92
+
93
+ ```sh
94
+ matrixai-lint --domain markdown
95
+ ```
96
+
97
+ - Markdown only under selected roots:
98
+
99
+ ```sh
100
+ matrixai-lint --markdown standards templates README.md
101
+ ```
102
+
103
+ - Mixed scoped run (ESLint + shell only):
104
+
105
+ ```sh
106
+ matrixai-lint --eslint "src/**/*.{ts,tsx}" --shell scripts
107
+ ```
108
+
109
+ #### Examples
44
110
 
45
111
  ```sh
46
112
  matrixai-lint --fix
47
113
  matrixai-lint --user-config
48
- matrixai-lint --config ./eslint.config.js --fix
114
+ matrixai-lint --eslint-config ./eslint.config.js --fix
115
+ matrixai-lint --eslint "src/**/*.{ts,tsx}" --shell scripts
116
+ matrixai-lint --markdown standards templates README.md
117
+ matrixai-lint --domain eslint markdown
118
+ matrixai-lint --skip-domain markdown
119
+ matrixai-lint --list-domains
120
+ matrixai-lint --explain --domain eslint
121
+ matrixai-lint -v -v --domain markdown
49
122
  ```
50
123
 
51
- ### TypeScript Support
124
+ ### ESLint config (ESM / NodeNext)
52
125
 
53
- The linter is TypeScript-aware and requires a `tsconfig.json` to determine which
54
- files to lint and how to parse them.
126
+ `matrixai-lint` ships an ESLint Flat Config array and types for TypeScript
127
+ projects configured as NodeNext.
55
128
 
56
- By default:
129
+ #### Default import
57
130
 
58
- - It looks for `tsconfig.json` in the project root
59
- - Files are selected based on the `include` and `exclude` fields in the tsconfig
131
+ ```js
132
+ // eslint.config.js
133
+ import { config } from '@matrixai/lint';
60
134
 
61
- ### Working with multiple tsconfigs
135
+ export default config;
136
+ ```
62
137
 
63
- If your project uses more than one `tsconfig.json` or doesn't have one at the
64
- root, you can configure the linter using a `matrixai-lint-config.json` file at
65
- the root:
138
+ #### Explicit subpath import
66
139
 
67
- ```json
68
- {
69
- "tsconfigPaths": ["./tsconfig.base.json", "./packages/core/tsconfig.json"],
70
- "forceInclude": ["scripts", "src/overrides"]
71
- }
72
- ```
140
+ ```js
141
+ // eslint.config.js
142
+ import matrixai from '@matrixai/lint/configs/eslint.js';
73
143
 
74
- | Field | Type | Description |
75
- | --------------- | ---------- | ---------------------------------------------------------------------------------------- |
76
- | `tsconfigPaths` | `string[]` | One or more paths to `tsconfig.json` files |
77
- | `forceInclude` | `string[]` | Paths to always include, even if excluded by tsconfig (must be included by at least one) |
144
+ export default matrixai;
145
+ ```
78
146
 
79
- > If a path in `forceInclude` is not included in any of the `tsconfigPaths`,
80
- > TypeScript will throw a parsing error.
147
+ ### Lint configuration file
81
148
 
82
- ### ESLint Config Override
149
+ The linter is TypeScript-aware and requires a `tsconfig.json` to determine which
150
+ files to lint and how to parse them. By default it looks for `tsconfig.json` in
151
+ the project root and uses the `include`/`exclude` entries.
83
152
 
84
- You can use your own ESLint config by one of the following methods:
153
+ If your project uses more than one `tsconfig.json` or does not have one at the
154
+ root, configure the linter using a `matrixai-lint-config.json` file at the root.
85
155
 
86
- #### 1. Inline Custom Config
156
+ This config uses a versioned schema and must explicitly declare `"version": 2`:
87
157
 
88
- ```sh
89
- matrixai-lint --config ./eslint.config.js
158
+ ```json
159
+ {
160
+ "version": 2,
161
+ "root": ".",
162
+ "domains": {
163
+ "eslint": {
164
+ "tsconfigPaths": [
165
+ "./tsconfig.base.json",
166
+ "./packages/core/tsconfig.json"
167
+ ],
168
+ "forceInclude": ["scripts", "src/overrides"]
169
+ }
170
+ }
171
+ }
90
172
  ```
91
173
 
92
- #### 2. Auto-detect with `--user-config`
174
+ | Field | Type | Description |
175
+ | ------------------------------ | ---------- | ----------------------------------------------------------------------------------------- |
176
+ | `version` | `2` | Required schema version marker |
177
+ | `root` | `string` | Optional lint root (defaults to `.`). `tsconfigPaths` are resolved relative to this root. |
178
+ | `domains.eslint.tsconfigPaths` | `string[]` | One or more paths to `tsconfig.json` files |
179
+ | `domains.eslint.forceInclude` | `string[]` | Paths to always include, even if excluded by tsconfig (must be included by at least one) |
93
180
 
94
- ```sh
95
- matrixai-lint --user-config
96
- ```
181
+ Note: If a path in `forceInclude` is not included in any of the `tsconfigPaths`,
182
+ TypeScript will throw a parsing error.
97
183
 
98
- This will look for a valid eslint.config file in the project root.
184
+ ### Public API
99
185
 
100
- Valid config filenames:
186
+ Supported imports:
101
187
 
102
- - `eslint.config.js`
103
- - `eslint.config.cjs`
104
- - `eslint.config.mjs`
105
- - `eslint.config.ts`
188
+ - `@matrixai/lint`: named export `config`; types `MatrixAILintCfg`,
189
+ `RawMatrixCfg`, `CLIOptions`.
190
+ - `@matrixai/lint/configs/eslint.js`: default export of the ESLint Flat Config
191
+ array (same shape as `config`).
192
+ - `@matrixai/lint/configs/prettier.config.js`: reusable Prettier options object.
106
193
 
107
- #### 3. Extend the base config
194
+ The exported `config` is intended as a composable base preset for downstream
195
+ `eslint.config.js` files, not as an internal-only implementation detail.
108
196
 
109
- ```ts
110
- // eslint.config.js
111
- import matrixai from '@matrixai/lint/config';
112
-
113
- export default [
114
- ...matrixai,
115
- {
116
- rules: {
117
- '@typescript-eslint/no-explicit-any': 'error',
118
- 'no-console': 'off',
119
- },
120
- },
121
- ];
122
- ```
197
+ Any package import path not listed above is internal and not a stable public
198
+ API.
123
199
 
124
- ## Development
200
+ ## Contributing
125
201
 
126
- Run `nix develop`, and once you're inside, you can use:
202
+ Golden commands:
127
203
 
128
- ```sh
129
- # install (or reinstall packages from package.json)
130
- npm install
131
- # build the dist
132
- npm run build
133
- # run the repl (this allows you to import from ./src)
134
- npm run tsx
135
- # run the tests
136
- npm run test
137
- # lint the source code
138
- npm run lint
139
- # automatically fix the source
140
- npm run lintfix
141
- ```
204
+ - `npm run build`
205
+ - `npm run lint`
206
+ - `npm run lintfix`
207
+ - `npm run docs`
142
208
 
143
- ### Docs Generation
209
+ Notes:
144
210
 
145
- ```sh
146
- npm run docs
147
- ```
211
+ - `npm run lint` and `npm run lintfix` invoke `npm run prepare` first so the
212
+ compiled CLI in `dist/bin/matrixai-lint.js` stays up to date while keeping
213
+ TypeScript incremental rebuilds fast.
214
+
215
+ For the authoritative contributor guidance see [AGENTS.md](AGENTS.md).
148
216
 
149
- See the docs at: https://matrixai.github.io/js-lint/
217
+ Docs: https://matrixai.github.io/js-lint/
150
218
 
151
219
  ### Publishing
152
220
 
@@ -0,0 +1,174 @@
1
+ #!/usr/bin/env node
2
+ import path from 'node:path';
3
+ import process from 'node:process';
4
+ import fs from 'node:fs';
5
+ import url from 'node:url';
6
+ import { Command, Option } from 'commander';
7
+ import Logger, { StreamHandler } from '@matrixai/logger';
8
+ import { LINT_DOMAINS, resolveDomainSelection, createBuiltInDomainRegistry, listLintDomains, evaluateLintDomains, runLintDomainDecisions, } from '../domains/index.js';
9
+ import * as utils from '../utils.js';
10
+ const program = new Command();
11
+ const dirname = path.dirname(url.fileURLToPath(import.meta.url));
12
+ const builtinPrettierCfg = path.resolve(dirname, '../configs/prettier.config.js');
13
+ program
14
+ .name('matrixai-lint')
15
+ .description('Lint source files, scripts, and markdown with configured rules.')
16
+ .addOption(new Option('-v, --verbose', 'Increase log verbosity')
17
+ .argParser((_, previous = 0) => previous + 1)
18
+ .default(0))
19
+ .option('-f, --fix', 'Automatically fix problems')
20
+ .option('--list-domains', 'List available lint domains and exit')
21
+ .option('--explain', 'Print per-domain selection and execution decisions')
22
+ .option('--user-config', 'Use user-provided ESLint config instead of built-in one')
23
+ .option('--eslint-config <path>', 'Path to explicit ESLint config file')
24
+ .option('--eslint <target...>', 'ESLint targets (files, roots, or globs)')
25
+ .option('--markdown <target...>', 'Markdown targets (files, roots, or globs)')
26
+ .option('--shell <target...>', 'Shell targets (files, roots, or globs) used to derive shellcheck search roots')
27
+ .addOption(new Option('--domain <id...>', `Run only selected domains (${LINT_DOMAINS.join(', ')})`).choices(LINT_DOMAINS))
28
+ .addOption(new Option('--skip-domain <id...>', `Skip selected domains (${LINT_DOMAINS.join(', ')})`).choices(LINT_DOMAINS));
29
+ function describeAvailability(decision) {
30
+ if (decision.detection == null) {
31
+ return 'not-evaluated';
32
+ }
33
+ const detection = decision.detection;
34
+ const status = detection.available ? 'available' : 'unavailable';
35
+ const reason = detection.unavailableReason;
36
+ return reason != null && reason.length > 0
37
+ ? `${status} (${detection.availabilityKind}; ${reason})`
38
+ : `${status} (${detection.availabilityKind})`;
39
+ }
40
+ function describeRelevance(decision) {
41
+ if (decision.detection == null) {
42
+ return decision.plannedAction === 'skip-unselected'
43
+ ? 'not-evaluated (domain not selected)'
44
+ : 'not-evaluated';
45
+ }
46
+ const detection = decision.detection;
47
+ const status = detection.relevant ? 'relevant' : 'not-relevant';
48
+ const reason = detection.relevanceReason;
49
+ return reason != null && reason.length > 0 ? `${status} (${reason})` : status;
50
+ }
51
+ function printDomainList(logger, domains) {
52
+ logger.info('Available lint domains:');
53
+ for (const domainInfo of domains) {
54
+ logger.info(`- ${domainInfo.domain}: ${domainInfo.description}`);
55
+ }
56
+ }
57
+ function printExplain(logger, decisions) {
58
+ logger.info('[matrixai-lint] Domain execution plan:');
59
+ for (const decision of decisions) {
60
+ logger.info(`[matrixai-lint] - domain: ${decision.domain}`);
61
+ logger.info(`[matrixai-lint] selection: ${decision.selectionSource}${decision.explicitlyRequested ? ' (explicit)' : ''}`);
62
+ logger.info(`[matrixai-lint] relevance: ${describeRelevance(decision)}`);
63
+ logger.info(`[matrixai-lint] availability: ${describeAvailability(decision)}`);
64
+ if (decision.detectionError != null) {
65
+ logger.error(`[matrixai-lint] detection-error: ${decision.detectionError}`);
66
+ }
67
+ logger.info(`[matrixai-lint] planned-action: ${decision.plannedAction}`);
68
+ }
69
+ }
70
+ async function main(argv = process.argv) {
71
+ await program.parseAsync(argv);
72
+ const options = program.opts();
73
+ const logger = new Logger('matrixai-lint', undefined, [new StreamHandler()]);
74
+ logger.setLevel(utils.verboseToLogLevel(options.verbose));
75
+ const fix = Boolean(options.fix);
76
+ const useUserConfig = Boolean(options.userConfig);
77
+ const explicitConfigPath = options.eslintConfig;
78
+ const listDomainsOnly = Boolean(options.listDomains);
79
+ const explain = Boolean(options.explain);
80
+ const eslintPatterns = options.eslint;
81
+ const markdownPatterns = options.markdown;
82
+ const shellPatterns = options.shell;
83
+ const { selectedDomains, explicitlyRequestedDomains, selectionSources } = resolveDomainSelection(options);
84
+ const domainRegistry = createBuiltInDomainRegistry({
85
+ prettierConfigPath: builtinPrettierCfg,
86
+ });
87
+ if (listDomainsOnly) {
88
+ printDomainList(logger, listLintDomains({
89
+ registry: domainRegistry,
90
+ executionOrder: LINT_DOMAINS,
91
+ }));
92
+ return;
93
+ }
94
+ let hadFailure = false;
95
+ // Resolve which config file to use
96
+ let chosenConfig;
97
+ let isConfigValid = true;
98
+ if (explicitConfigPath !== undefined) {
99
+ const absolutePath = path.resolve(explicitConfigPath);
100
+ if (!fs.existsSync(absolutePath)) {
101
+ logger.error(`--eslint-config points to "${explicitConfigPath}", but that file does not exist.`);
102
+ hadFailure = true;
103
+ isConfigValid = false;
104
+ }
105
+ else {
106
+ chosenConfig = absolutePath;
107
+ }
108
+ }
109
+ else if (useUserConfig) {
110
+ chosenConfig = utils.findUserESLintConfig();
111
+ if (chosenConfig === undefined) {
112
+ logger.warn('--user-config given but no local ESLint config was found. Falling back to built-in config.');
113
+ }
114
+ }
115
+ const decisions = await evaluateLintDomains({
116
+ registry: domainRegistry,
117
+ selectedDomains,
118
+ explicitlyRequestedDomains,
119
+ selectionSources,
120
+ executionOrder: LINT_DOMAINS,
121
+ context: {
122
+ fix,
123
+ logger,
124
+ chosenConfig,
125
+ isConfigValid,
126
+ eslintPatterns,
127
+ markdownPatterns,
128
+ shellPatterns,
129
+ },
130
+ });
131
+ if (explain) {
132
+ printExplain(logger, decisions);
133
+ }
134
+ const hadDomainFailure = await runLintDomainDecisions({
135
+ registry: domainRegistry,
136
+ decisions,
137
+ context: {
138
+ fix,
139
+ logger,
140
+ chosenConfig,
141
+ isConfigValid,
142
+ eslintPatterns,
143
+ markdownPatterns,
144
+ shellPatterns,
145
+ },
146
+ });
147
+ if (hadDomainFailure) {
148
+ hadFailure = true;
149
+ }
150
+ if (hadFailure) {
151
+ logger.error('[matrixai-lint] ✖ Linting failed.');
152
+ process.exit(1);
153
+ }
154
+ else {
155
+ logger.info('[matrixai-lint] ✔ Linting passed.');
156
+ }
157
+ }
158
+ if (import.meta.url.startsWith('file:') && process.argv[1] != null) {
159
+ const entryPath = process.argv[1];
160
+ let entryUrl;
161
+ try {
162
+ entryUrl = entryPath.startsWith('file:')
163
+ ? new URL(entryPath).href
164
+ : url.pathToFileURL(fs.realpathSync.native(entryPath)).href;
165
+ }
166
+ catch {
167
+ entryUrl = url.pathToFileURL(path.resolve(entryPath)).href;
168
+ }
169
+ if (entryUrl === new URL(import.meta.url).href) {
170
+ void main();
171
+ }
172
+ }
173
+ export default main;
174
+ //# sourceMappingURL=matrixai-lint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matrixai-lint.js","sourceRoot":"","sources":["../../src/bin/matrixai-lint.ts"],"names":[],"mappings":";AAEA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,MAAM,EAAE,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,2BAA2B,EAC3B,eAAe,EACf,mBAAmB,EACnB,sBAAsB,GAEvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AAErC,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACjE,MAAM,kBAAkB,GAAG,IAAI,CAAC,OAAO,CACrC,OAAO,EACP,+BAA+B,CAChC,CAAC;AAEF,OAAO;KACJ,IAAI,CAAC,eAAe,CAAC;KACrB,WAAW,CACV,iEAAiE,CAClE;KACA,SAAS,CACR,IAAI,MAAM,CAAC,eAAe,EAAE,wBAAwB,CAAC;KAClD,SAAS,CAAC,CAAC,CAAS,EAAE,WAAmB,CAAC,EAAE,EAAE,CAAC,QAAQ,GAAG,CAAC,CAAC;KAC5D,OAAO,CAAC,CAAC,CAAC,CACd;KACA,MAAM,CAAC,WAAW,EAAE,4BAA4B,CAAC;KACjD,MAAM,CAAC,gBAAgB,EAAE,sCAAsC,CAAC;KAChE,MAAM,CAAC,WAAW,EAAE,oDAAoD,CAAC;KACzE,MAAM,CACL,e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gB,EAAE;QACpB,UAAU,GAAG,IAAI,CAAC;KACnB;IAED,IAAI,UAAU,EAAE;QACd,MAAM,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;SAAM;QACL,MAAM,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC;KACpD;AACH,CAAC;AAED,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE;IAClE,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClC,IAAI,QAAgB,CAAC;IACrB,IAAI;QACF,QAAQ,GAAG,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC;YACtC,CAAC,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI;YACzB,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;KAC/D;IAAC,MAAM;QACN,QAAQ,GAAG,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;KAC5D;IACD,IAAI,QAAQ,KAAK,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE;QAC9C,KAAK,IAAI,EAAE,CAAC;KACb;CACF;AAED,eAAe,IAAI,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { MatrixAILintCfgSource, MatrixAILintCfgResolved, RawMatrixCfg } from './types.js';
2
+ declare const MATRIXAI_LINT_CONFIG_FILENAME = "matrixai-lint-config.json";
3
+ declare function normalizeLintConfig({ rawConfig, source, repoRoot, configFilePath, }: {
4
+ rawConfig: RawMatrixCfg;
5
+ source: MatrixAILintCfgSource;
6
+ repoRoot: string;
7
+ configFilePath: string;
8
+ }): MatrixAILintCfgResolved;
9
+ declare function parseLintConfig({ rawConfig, repoRoot, configFilePath, }: {
10
+ rawConfig: unknown;
11
+ repoRoot: string;
12
+ configFilePath: string;
13
+ }): MatrixAILintCfgResolved;
14
+ declare function resolveLintConfig(repoRoot?: string): MatrixAILintCfgResolved;
15
+ export { MATRIXAI_LINT_CONFIG_FILENAME, normalizeLintConfig, parseLintConfig, resolveLintConfig, };
package/dist/config.js ADDED
@@ -0,0 +1,120 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import process from 'node:process';
4
+ import ts from 'typescript';
5
+ const MATRIXAI_LINT_CONFIG_FILENAME = 'matrixai-lint-config.json';
6
+ function isRecord(value) {
7
+ return typeof value === 'object' && value !== null;
8
+ }
9
+ function toStringArray(value) {
10
+ if (typeof value === 'string') {
11
+ return [value];
12
+ }
13
+ if (Array.isArray(value)) {
14
+ return value.filter((item) => typeof item === 'string');
15
+ }
16
+ return [];
17
+ }
18
+ function stripLeadingDotSlash(value) {
19
+ return value.replace(/^\.\//, '');
20
+ }
21
+ function dedupeAndSort(values) {
22
+ return [...new Set(values)].sort();
23
+ }
24
+ function isReadableTsconfigPath(tsconfigPath) {
25
+ let stats;
26
+ try {
27
+ stats = fs.statSync(tsconfigPath);
28
+ }
29
+ catch {
30
+ return false;
31
+ }
32
+ if (!stats.isFile()) {
33
+ return false;
34
+ }
35
+ const readResult = ts.readConfigFile(tsconfigPath, ts.sys.readFile);
36
+ return readResult.error == null;
37
+ }
38
+ function sanitizeTsconfigPaths(rawValue, root) {
39
+ return dedupeAndSort(toStringArray(rawValue)
40
+ .map((tsconfigPath) => path.resolve(root, tsconfigPath))
41
+ .filter((tsconfigPath) => isReadableTsconfigPath(tsconfigPath)));
42
+ }
43
+ function sanitizeForceInclude(rawValue) {
44
+ return dedupeAndSort(toStringArray(rawValue)
45
+ .map((glob) => stripLeadingDotSlash(glob))
46
+ .filter((glob) => glob.length > 0));
47
+ }
48
+ function normalizeLintConfig({ rawConfig, source, repoRoot, configFilePath, }) {
49
+ const rawRoot = typeof rawConfig.root === 'string' && rawConfig.root.length > 0
50
+ ? rawConfig.root
51
+ : '.';
52
+ const resolvedRoot = path.resolve(repoRoot, rawRoot);
53
+ const rawDomains = isRecord(rawConfig.domains)
54
+ ? rawConfig.domains
55
+ : {};
56
+ const rawEslintDomain = isRecord(rawDomains.eslint)
57
+ ? rawDomains.eslint
58
+ : {};
59
+ let tsconfigPaths = sanitizeTsconfigPaths(rawEslintDomain.tsconfigPaths, resolvedRoot);
60
+ const forceInclude = sanitizeForceInclude(rawEslintDomain.forceInclude);
61
+ if (tsconfigPaths.length === 0) {
62
+ const rootTsconfigPath = path.join(resolvedRoot, 'tsconfig.json');
63
+ if (isReadableTsconfigPath(rootTsconfigPath)) {
64
+ tsconfigPaths.push(rootTsconfigPath);
65
+ }
66
+ }
67
+ tsconfigPaths = dedupeAndSort(tsconfigPaths);
68
+ return {
69
+ version: 2,
70
+ root: resolvedRoot,
71
+ source,
72
+ configFilePath,
73
+ domains: {
74
+ eslint: {
75
+ tsconfigPaths,
76
+ forceInclude,
77
+ },
78
+ },
79
+ };
80
+ }
81
+ function parseLintConfig({ rawConfig, repoRoot, configFilePath, }) {
82
+ if (!isRecord(rawConfig)) {
83
+ throw new Error('[matrixai-lint] ✖ matrixai-lint-config.json must contain a JSON object.');
84
+ }
85
+ if (rawConfig.version !== 2) {
86
+ throw new Error('[matrixai-lint] ✖ matrixai-lint-config.json must declare "version": 2.');
87
+ }
88
+ return normalizeLintConfig({
89
+ rawConfig: rawConfig,
90
+ source: 'config',
91
+ repoRoot,
92
+ configFilePath,
93
+ });
94
+ }
95
+ function resolveLintConfig(repoRoot = process.cwd()) {
96
+ const configFilePath = path.join(repoRoot, MATRIXAI_LINT_CONFIG_FILENAME);
97
+ if (!fs.existsSync(configFilePath)) {
98
+ return normalizeLintConfig({
99
+ rawConfig: { version: 2 },
100
+ source: 'default',
101
+ repoRoot,
102
+ configFilePath,
103
+ });
104
+ }
105
+ let rawConfig = {};
106
+ try {
107
+ const text = fs.readFileSync(configFilePath, 'utf8').trim();
108
+ rawConfig = text.length > 0 ? JSON.parse(text) : {};
109
+ }
110
+ catch (error) {
111
+ throw new Error(`[matrixai-lint] ✖ matrixai-lint-config.json has been provided but it is not valid JSON.\n ${String(error)}`);
112
+ }
113
+ return parseLintConfig({
114
+ rawConfig,
115
+ repoRoot,
116
+ configFilePath,
117
+ });
118
+ }
119
+ export { MATRIXAI_LINT_CONFIG_FILENAME, normalizeLintConfig, parseLintConfig, resolveLintConfig, };
120
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,MAAM,6BAA6B,GAAG,2BAA2B,CAAC;AAElE,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACrD,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,OAAO,CAAC,KAAK,CAAC,CAAC;KAChB;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC;KACzE;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAa;IACzC,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,aAAa,CAAC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,SAAS,CAAC,OAAO,KAAK,CAAC,EAAE;QAC3B,MAAM,IAAI,KAAK,CACb,0EAA0E,CAC3E,CAAC;KACH;IAED,OAAO,mBAAmB,CAAC;QACzB,SAAS,EAAE,SAAyB;QACpC,MAAM,EAAE,QAAQ;QAChB,QAAQ;QACR,cAAc;KACf,CAAC,CAAC;AACL,CAAC;AAED,SAAS,iBAAiB,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE;IACjD,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,6BAA6B,CAAC,CAAC;IAE1E,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE;QAClC,OAAO,mBAAmB,CAAC;YACzB,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE;YACzB,MAAM,EAAE,SAAS;YACjB,QAAQ;YACR,cAAc;SACf,CAAC,CAAC;KACJ;IAED,IAAI,SAAS,GAAY,EAAE,CAAC;IAE5B,IAAI;QACF,MAAM,IAAI,GAAG,EAAE,CAAC,YAAY,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;QAC5D,SAAS,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KACrD;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,IAAI,KAAK,CACb,+FAA+F,MAAM,CAAC,KAAK,CAAC,EAAE,CAC/G,CAAC;KACH;IAED,OAAO,eAAe,CAAC;QACrB,SAAS;QACT,QAAQ;QACR,cAAc;KACf,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EACL,6BAA6B,EAC7B,mBAAmB,EACnB,eAAe,EACf,iBAAiB,GAClB,CAAC"}
@@ -6,9 +6,10 @@ import js from '@eslint/js';
6
6
  import tsParser from '@typescript-eslint/parser';
7
7
  import { FlatCompat } from '@eslint/eslintrc';
8
8
  import { fixupPluginRules } from '@eslint/compat';
9
- import prettierOptions from './prettier.config.mjs';
9
+ import prettierOptions from './prettier.config.js';
10
10
  import matrixaiPlugin from '../plugins/eslint-plugin-matrixai.js';
11
- import { resolveMatrixConfig } from '../utils.js';
11
+ import { resolveLintConfig } from '../config.js';
12
+ const resolvedLintConfig = resolveLintConfig();
12
13
  const filename = fileURLToPath(import.meta.url);
13
14
  const dirname = path.dirname(filename);
14
15
  const compat = new FlatCompat({
@@ -39,7 +40,7 @@ const config = [
39
40
  ecmaVersion: 5,
40
41
  sourceType: 'module',
41
42
  parserOptions: {
42
- project: resolveMatrixConfig().tsconfigPaths,
43
+ project: resolvedLintConfig.domains.eslint.tsconfigPaths,
43
44
  },
44
45
  },
45
46
  rules: {
@@ -246,4 +247,4 @@ const config = [
246
247
  },
247
248
  ];
248
249
  export default config;
249
- //# sourceMappingURL=js.js.map
250
+ //# sourceMappingURL=eslint.js.map