Skip to content

Commit 640ab27

Browse files
committed
feat(newlines,boundaries,notice,logger): port 4 vendor families and activate mappings
Vendor eslint-plugin-import-newlines 1.4.0, eslint-plugin-boundaries 5.0.1 (element-types), eslint-plugin-notice 1.0.0, and the tsurlfilter logger-context rule as strict TypeScript ports with whole-file before/after patches, register ag-newlines/ag-boundaries/ ag-notice/ag-logger providers, and activate catalog mappings (import-newlines error, boundaries allow/test-folder, notice off per-project headers, logger ext). Adds gap CLI cases and 4 source-ports fingerprints; replaces minimatch capture with a dedicated glob compiler for micromatch-compatible element matching. 402 enabled rules.
1 parent 93bd3a2 commit 640ab27

69 files changed

Lines changed: 3632 additions & 28 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.oxlintrc.json‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@
7373
"rules": {
7474
"ag-jsdoc/require-file-overview": "off",
7575
"ag-compat/no-constant-condition": "off",
76-
"ag-compat/sort-imports": "off"
76+
"ag-compat/sort-imports": "off",
77+
"ag-newlines/enforce": "off",
78+
"ag-jsdoc/require-param-description": "off",
79+
"ag-jsdoc/check-param-names": "off",
80+
"ag-jsdoc/require-param": "off"
7781
}
7882
},
7983
{

‎docs/coverage.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,10 @@ Generated by `pnpm catalog:generate`. Sample settings and inherited disabled rul
678678
| sort-imports | ag-compat/sort-imports | javascript | `["error",{"ignoreCase":true,"ignoreDeclarationSort":true,"ignoreMemberSort":false,"memberSyntaxSortOrder":["none","all","multiple","single"]}]` | Javascript.md |
679679
| no-restricted-imports | ag-compat/no-restricted-imports | javascript | `["error",{"patterns":[{"group":["**/*-mv2","**/*-mv3"],"message":"Do not import directly from MV2/MV3 implementations. Use the appropriate alias or index file instead."}]}]` | Javascript.md |
680680
| import/no-unassigned-import | ag-import/no-unassigned-import | javascript | `["error",{"allow":["**/*.pcss"]}]` | Javascript.md |
681+
| import-newlines/enforce | ag-newlines/enforce | javascript | `["error",{"items":3,"max-len":120}]` | Javascript.md |
682+
| boundaries/element-types | ag-boundaries/element-types | javascript | `["error",{"default":"allow","rules":[{"from":"test-folder","disallow":["src-index"],"message":"Do not import directly from src/. Use specific submodules like src/utils instead."}]}]` | Javascript.md |
683+
| notice/notice | disabled | disabled | `"off"` | Javascript.md |
684+
| @adguard/logger-context/require-logger-context | ag-logger/require-logger-context | javascript | `["error",{"contextModuleName":"ext"}]` | Javascript.md |
681685
| unicorn/prefer-node-protocol | unicorn/prefer-node-protocol | native | `"error"` | Javascript.md |
682686
| unicorn/no-this-assignment | unicorn/no-this-assignment | native | `"error"` | Javascript.md |
683687
| ag/no-accessors | ag/no-accessors | custom | `"error"` | Javascript.md |

‎docs/reference/sources.json‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,34 @@
4545
"ref": "v5.10.0",
4646
"directory": "eslint-stylistic-5.10.0",
4747
"archiveSha256": "73776b7c13f561d40da170ca67cc7293ab37e50ce44ba187fb845d4c999cc252"
48+
},
49+
"import-newlines": {
50+
"repository": "SeinopSys/eslint-plugin-import-newlines",
51+
"version": "1.4.0",
52+
"ref": "v1.4.0",
53+
"directory": "eslint-plugin-import-newlines-1.4.0",
54+
"archiveSha256": "2be9dc68163fe946956148824b846e5751499a5ecaf63fa35dfb0f3b48f0307e"
55+
},
56+
"boundaries": {
57+
"repository": "javierbrea/eslint-plugin-boundaries",
58+
"version": "5.0.1",
59+
"ref": "v5.0.1",
60+
"directory": "eslint-plugin-boundaries-5.0.1",
61+
"archiveSha256": "96f41648a57f58e1bbb0ab75d8e08bd9b7bd995285a6a0fedec5fa8672e56b1f"
62+
},
63+
"notice": {
64+
"repository": "nickdeis/eslint-plugin-notice",
65+
"version": "1.0.0",
66+
"ref": "1.0.0",
67+
"directory": "eslint-plugin-notice-1.0.0",
68+
"archiveSha256": "fa5eaeefe812381d2ba3cb6c2215616f4f64bd202e2796e9cc0570fe0953c380"
69+
},
70+
"logger-context": {
71+
"repository": "AdguardTeam/tsurlfilter",
72+
"version": "1.0.1",
73+
"ref": "v1.0.1",
74+
"directory": "adguard-eslint-plugin-logger-context-1.0.1",
75+
"archiveSha256": "862a099a34a0c4c4dd2070cfa1fe47072345976156cff5c3028a87e572ed36a2"
4876
}
4977
}
5078
}

‎packages/oxlint-config/src/index.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ export function createConfig(options: ConfigOptions | Language = {}): OxlintConf
3939
'ag-react': '@agcodeguidelines/oxlint-plugin/react',
4040
'ag-a11y': '@agcodeguidelines/oxlint-plugin/jsx-a11y',
4141
'ag-import': '@agcodeguidelines/oxlint-plugin/import',
42+
'ag-newlines': '@agcodeguidelines/oxlint-plugin/newlines',
43+
'ag-boundaries': '@agcodeguidelines/oxlint-plugin/boundaries',
44+
'ag-notice': '@agcodeguidelines/oxlint-plugin/notice',
45+
'ag-logger': '@agcodeguidelines/oxlint-plugin/logger',
4246
};
4347
// Oxlint's native React settings schema cannot represent version detection.
4448
settings.agReact = settings.react;

‎packages/oxlint-plugin/package.json‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,22 @@
3131
"./import": {
3232
"types": "./dist/import.d.ts",
3333
"default": "./dist/import.js"
34+
},
35+
"./newlines": {
36+
"types": "./dist/newlines.d.ts",
37+
"default": "./dist/newlines.js"
38+
},
39+
"./boundaries": {
40+
"types": "./dist/boundaries.d.ts",
41+
"default": "./dist/boundaries.js"
42+
},
43+
"./notice": {
44+
"types": "./dist/notice.d.ts",
45+
"default": "./dist/notice.js"
46+
},
47+
"./logger": {
48+
"types": "./dist/logger.d.ts",
49+
"default": "./dist/logger.js"
3450
}
3551
},
3652
"files": [
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/** @file Run the boundaries rules through Oxlint. */
2+
import type { Plugin, Rule } from '@oxlint/plugins';
3+
import plugin from '../../../vendor/boundaries/index';
4+
import { legacyContext } from './legacy-context';
5+
6+
export default {
7+
...plugin,
8+
rules: Object.fromEntries(
9+
Object.entries(plugin.rules).map(([name, rule]) => [
10+
name,
11+
{
12+
...rule,
13+
create(context) {
14+
return legacyContext(rule as unknown as Rule, context);
15+
},
16+
} satisfies Rule,
17+
]),
18+
),
19+
} as Plugin;

‎packages/oxlint-plugin/src/index.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import { definePlugin, defineRule } from '@oxlint/plugins';
55

66
import type { ESTree, RuleMeta } from '@oxlint/plugins';
77
import {
8-
isDefaultMutation, isPascalCase, memberName, writesPrototype,
8+
isDefaultMutation,
9+
isPascalCase,
10+
memberName,
11+
writesPrototype,
912
} from './helpers';
1013

1114
/**
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/** @file Run the logger-context rules through Oxlint. */
2+
import type { Plugin, Rule } from '@oxlint/plugins';
3+
import plugin from '../../../vendor/logger-context/index';
4+
import { legacyContext } from './legacy-context';
5+
6+
export default {
7+
...plugin,
8+
rules: Object.fromEntries(
9+
Object.entries(plugin.rules).map(([name, rule]) => [
10+
name,
11+
{
12+
...rule,
13+
create(context) {
14+
return legacyContext(rule as unknown as Rule, context);
15+
},
16+
} satisfies Rule,
17+
]),
18+
),
19+
} as Plugin;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/** @file Run the import-newlines rules through Oxlint. */
2+
import type { Plugin, Rule } from '@oxlint/plugins';
3+
import plugin from '../../../vendor/import-newlines/index';
4+
import { legacyContext } from './legacy-context';
5+
6+
export default {
7+
...plugin,
8+
rules: Object.fromEntries(
9+
Object.entries(plugin.rules).map(([name, rule]) => [
10+
name,
11+
{
12+
...rule,
13+
create(context) {
14+
return legacyContext(rule as unknown as Rule, context);
15+
},
16+
} satisfies Rule,
17+
]),
18+
),
19+
} as Plugin;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/** @file Run the notice rules through Oxlint. */
2+
import type { Plugin, Rule } from '@oxlint/plugins';
3+
import plugin from '../../../vendor/notice/index';
4+
import { legacyContext } from './legacy-context';
5+
6+
export default {
7+
...plugin,
8+
rules: Object.fromEntries(
9+
Object.entries(plugin.rules).map(([name, rule]) => [
10+
name,
11+
{
12+
...rule,
13+
create(context) {
14+
return legacyContext(rule as unknown as Rule, context);
15+
},
16+
} satisfies Rule,
17+
]),
18+
),
19+
} as Plugin;

0 commit comments

Comments
 (0)