@archon-research/oxlint-config 0.3.1 → 0.4.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 CHANGED
@@ -34,7 +34,19 @@ export default defineConfig({
34
34
  });
35
35
  ```
36
36
 
37
+ ### React projects with design-system import governance
38
+
39
+ ```typescript
40
+ import boundariesConfig from '@archon-research/oxlint-config/design-system-boundaries';
41
+ import { defineConfig } from 'oxlint';
42
+
43
+ export default defineConfig({
44
+ ...boundariesConfig,
45
+ });
46
+ ```
47
+
37
48
  ## Included presets
38
49
 
39
50
  - **base** (default) - General linting rules
40
51
  - **react** - Additional rules for React projects
52
+ - **design-system-boundaries** - React rules plus warnings for direct primitive imports from `@ark-ui/react/*`
@@ -0,0 +1,30 @@
1
+ import reactConfig from './react.js';
2
+
3
+ const designSystemBoundariesConfig = {
4
+ ...reactConfig,
5
+ rules: {
6
+ ...reactConfig.rules,
7
+ // Warn consumers when they bypass design-system entrypoints.
8
+ 'no-restricted-imports': [
9
+ 'warn',
10
+ {
11
+ paths: [
12
+ {
13
+ name: '@ark-ui/react',
14
+ message:
15
+ 'Import from @archon-research/design-system instead of @ark-ui/react.',
16
+ },
17
+ ],
18
+ patterns: [
19
+ {
20
+ group: ['@ark-ui/react/*'],
21
+ message:
22
+ 'Import from @archon-research/design-system instead of @ark-ui/react subpaths.',
23
+ },
24
+ ],
25
+ },
26
+ ],
27
+ },
28
+ };
29
+
30
+ export default designSystemBoundariesConfig;
@@ -0,0 +1,21 @@
1
+ declare const designSystemBoundariesConfig: {
2
+ rules: {
3
+ 'no-restricted-imports': (string | {
4
+ paths: {
5
+ name: string;
6
+ message: string;
7
+ }[];
8
+ patterns: {
9
+ group: string[];
10
+ message: string;
11
+ }[];
12
+ })[];
13
+ 'react/react-in-jsx-scope': string;
14
+ };
15
+ plugins: string[];
16
+ categories: {
17
+ correctness: string;
18
+ suspicious: string;
19
+ };
20
+ };
21
+ export default designSystemBoundariesConfig;
@@ -0,0 +1,26 @@
1
+ import reactConfig from './react.js';
2
+ const designSystemBoundariesConfig = {
3
+ ...reactConfig,
4
+ rules: {
5
+ ...reactConfig.rules,
6
+ // Warn consumers when they bypass design-system entrypoints.
7
+ 'no-restricted-imports': [
8
+ 'warn',
9
+ {
10
+ paths: [
11
+ {
12
+ name: '@ark-ui/react',
13
+ message: 'Import from @archon-research/design-system instead of @ark-ui/react.',
14
+ },
15
+ ],
16
+ patterns: [
17
+ {
18
+ group: ['@ark-ui/react/*'],
19
+ message: 'Import from @archon-research/design-system instead of @ark-ui/react subpaths.',
20
+ },
21
+ ],
22
+ },
23
+ ],
24
+ },
25
+ };
26
+ export default designSystemBoundariesConfig;
package/package.json CHANGED
@@ -7,13 +7,18 @@
7
7
  "files": [
8
8
  "dist",
9
9
  "base.ts",
10
- "react.ts"
10
+ "react.ts",
11
+ "design-system-boundaries.ts"
11
12
  ],
12
13
  "scripts": {
13
14
  "build": "tsc -p tsconfig.build.json",
14
15
  "clean": "rm -rf dist",
15
16
  "prepare": "npm run build",
16
- "type:check": "tsgo -p tsconfig.json --noEmit"
17
+ "type:check": "tsgo -p tsconfig.json --noEmit",
18
+ "lint": "oxlint -c oxlint.config.ts *.ts",
19
+ "lint:fix": "oxlint -c oxlint.config.ts --fix *.ts",
20
+ "format": "oxfmt -c oxfmt.config.ts --write *.ts",
21
+ "format:check": "oxfmt -c oxfmt.config.ts --check *.ts"
17
22
  },
18
23
  "exports": {
19
24
  "./base": {
@@ -23,9 +28,17 @@
23
28
  "./react": {
24
29
  "types": "./dist/react.d.ts",
25
30
  "default": "./dist/react.js"
31
+ },
32
+ "./design-system-boundaries": {
33
+ "types": "./dist/design-system-boundaries.d.ts",
34
+ "default": "./dist/design-system-boundaries.js"
26
35
  }
27
36
  },
28
- "version": "0.3.1",
37
+ "devDependencies": {
38
+ "oxfmt": "0.50.0",
39
+ "oxlint": "1.65.0"
40
+ },
41
+ "version": "0.4.0",
29
42
  "repository": {
30
43
  "url": "https://github.com/archon-research/uikit"
31
44
  }