@venizia/dev-configs 0.2.1 → 0.3.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.
Files changed (99) hide show
  1. package/README.md +224 -41
  2. package/dist/{compile.d.ts → compilers/bun.d.ts} +1 -1
  3. package/dist/compilers/bun.d.ts.map +1 -0
  4. package/dist/{compile.js → compilers/bun.js} +8 -9
  5. package/dist/compilers/bun.js.map +1 -0
  6. package/dist/compilers/index.d.ts +2 -0
  7. package/dist/compilers/index.d.ts.map +1 -0
  8. package/dist/compilers/index.js +18 -0
  9. package/dist/compilers/index.js.map +1 -0
  10. package/dist/formatters/index.d.ts +3 -0
  11. package/dist/formatters/index.d.ts.map +1 -0
  12. package/dist/formatters/index.js +19 -0
  13. package/dist/formatters/index.js.map +1 -0
  14. package/dist/formatters/oxfmt.d.ts +28 -0
  15. package/dist/formatters/oxfmt.d.ts.map +1 -0
  16. package/dist/formatters/oxfmt.js +42 -0
  17. package/dist/formatters/oxfmt.js.map +1 -0
  18. package/dist/formatters/prettier.d.ts +3 -0
  19. package/dist/formatters/prettier.d.ts.map +1 -0
  20. package/dist/{prettier.js → formatters/prettier.js} +2 -2
  21. package/dist/formatters/prettier.js.map +1 -0
  22. package/dist/index.d.ts +3 -4
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +3 -4
  25. package/dist/index.js.map +1 -1
  26. package/dist/linters/browser.d.ts +18 -0
  27. package/dist/linters/browser.d.ts.map +1 -0
  28. package/dist/linters/browser.js +31 -0
  29. package/dist/linters/browser.js.map +1 -0
  30. package/dist/linters/eslint.d.ts +20 -0
  31. package/dist/linters/eslint.d.ts.map +1 -0
  32. package/dist/linters/eslint.js +152 -0
  33. package/dist/linters/eslint.js.map +1 -0
  34. package/dist/linters/index.d.ts +6 -0
  35. package/dist/linters/index.d.ts.map +1 -0
  36. package/dist/linters/index.js +22 -0
  37. package/dist/linters/index.js.map +1 -0
  38. package/dist/linters/oxlint.d.ts +19 -0
  39. package/dist/linters/oxlint.d.ts.map +1 -0
  40. package/dist/linters/oxlint.js +166 -0
  41. package/dist/linters/oxlint.js.map +1 -0
  42. package/dist/linters/react.d.ts +59 -0
  43. package/dist/linters/react.d.ts.map +1 -0
  44. package/dist/linters/react.js +178 -0
  45. package/dist/linters/react.js.map +1 -0
  46. package/dist/linters/rules/common.d.ts +6 -0
  47. package/dist/linters/rules/common.d.ts.map +1 -0
  48. package/dist/linters/rules/common.js +3 -0
  49. package/dist/linters/rules/common.js.map +1 -0
  50. package/dist/linters/rules/eqeqeq.rule.d.ts +10 -0
  51. package/dist/linters/rules/eqeqeq.rule.d.ts.map +1 -0
  52. package/dist/linters/rules/eqeqeq.rule.js +13 -0
  53. package/dist/linters/rules/eqeqeq.rule.js.map +1 -0
  54. package/dist/linters/rules/index.d.ts +9 -0
  55. package/dist/linters/rules/index.d.ts.map +1 -0
  56. package/dist/linters/rules/index.js +25 -0
  57. package/dist/linters/rules/index.js.map +1 -0
  58. package/dist/linters/rules/naming-convention.rule.d.ts +20 -0
  59. package/dist/linters/rules/naming-convention.rule.d.ts.map +1 -0
  60. package/dist/linters/rules/naming-convention.rule.js +64 -0
  61. package/dist/linters/rules/naming-convention.rule.js.map +1 -0
  62. package/dist/linters/rules/no-restricted-imports.rule.d.ts +17 -0
  63. package/dist/linters/rules/no-restricted-imports.rule.d.ts.map +1 -0
  64. package/dist/linters/rules/no-restricted-imports.rule.js +19 -0
  65. package/dist/linters/rules/no-restricted-imports.rule.js.map +1 -0
  66. package/dist/linters/rules/no-restricted-properties.rule.d.ts +22 -0
  67. package/dist/linters/rules/no-restricted-properties.rule.d.ts.map +1 -0
  68. package/dist/linters/rules/no-restricted-properties.rule.js +24 -0
  69. package/dist/linters/rules/no-restricted-properties.rule.js.map +1 -0
  70. package/dist/linters/rules/no-unused-vars.rule.d.ts +12 -0
  71. package/dist/linters/rules/no-unused-vars.rule.d.ts.map +1 -0
  72. package/dist/linters/rules/no-unused-vars.rule.js +13 -0
  73. package/dist/linters/rules/no-unused-vars.rule.js.map +1 -0
  74. package/dist/linters/rules/prefer-nullish-coalescing.rule.d.ts +12 -0
  75. package/dist/linters/rules/prefer-nullish-coalescing.rule.d.ts.map +1 -0
  76. package/dist/linters/rules/prefer-nullish-coalescing.rule.js +13 -0
  77. package/dist/linters/rules/prefer-nullish-coalescing.rule.js.map +1 -0
  78. package/dist/linters/rules/switch-case-braces.rule.d.ts +10 -0
  79. package/dist/linters/rules/switch-case-braces.rule.d.ts.map +1 -0
  80. package/dist/linters/rules/switch-case-braces.rule.js +13 -0
  81. package/dist/linters/rules/switch-case-braces.rule.js.map +1 -0
  82. package/package.json +43 -16
  83. package/{tsconfig → src/tsconfig}/tsconfig.base.json +2 -2
  84. package/src/tsconfig/tsconfig.browser.json +11 -0
  85. package/{tsconfig → src/tsconfig}/tsconfig.common.json +1 -1
  86. package/src/tsconfig/tsconfig.react.json +7 -0
  87. package/dist/compile.d.ts.map +0 -1
  88. package/dist/compile.js.map +0 -1
  89. package/dist/eslint.d.ts +0 -3
  90. package/dist/eslint.d.ts.map +0 -1
  91. package/dist/eslint.js +0 -25
  92. package/dist/eslint.js.map +0 -1
  93. package/dist/prettier.d.ts +0 -3
  94. package/dist/prettier.d.ts.map +0 -1
  95. package/dist/prettier.js.map +0 -1
  96. package/dist/react.d.ts +0 -32
  97. package/dist/react.d.ts.map +0 -1
  98. package/dist/react.js +0 -111
  99. package/dist/react.js.map +0 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@venizia/dev-configs",
3
- "version": "0.2.1",
4
- "description": "Shareable development configurations for TypeScript projects: ESLint v9 flat config (with unicorn plugin), Prettier formatting, and TypeScript compiler options with critical decorator support (experimentalDecorators, emitDecoratorMetadata, useDefineForClassFields). Single source of truth for consistent code style, type checking, and build settings across monorepo packages. 3-line consumption pattern per config.",
3
+ "version": "0.3.1-0",
4
+ "description": "Shareable development configurations for TypeScript projects: oxlint and oxfmt presets with per-rule builders, the ESLint naming-convention rule, the legacy ESLint flat config and Prettier presets, and TypeScript compiler options with critical decorator support (experimentalDecorators, emitDecoratorMetadata, useDefineForClassFields). Single source of truth for consistent code style, type checking, and build settings across monorepo packages.",
5
5
  "keywords": [
6
6
  "build-tools",
7
7
  "bun",
@@ -29,6 +29,8 @@
29
29
  "monorepo",
30
30
  "monorepo-config",
31
31
  "nodejs",
32
+ "oxfmt",
33
+ "oxlint",
32
34
  "prettier",
33
35
  "prettier-config",
34
36
  "settings",
@@ -64,15 +66,29 @@
64
66
  "types": "./dist/index.d.ts",
65
67
  "default": "./dist/index.js"
66
68
  },
67
- "./tsconfig.base.json": "./tsconfig/tsconfig.base.json",
68
- "./tsconfig.common.json": "./tsconfig/tsconfig.common.json",
69
+ "./compilers": {
70
+ "types": "./dist/compilers/index.d.ts",
71
+ "default": "./dist/compilers/index.js"
72
+ },
73
+ "./formatters": {
74
+ "types": "./dist/formatters/index.d.ts",
75
+ "default": "./dist/formatters/index.js"
76
+ },
77
+ "./linters": {
78
+ "types": "./dist/linters/index.d.ts",
79
+ "default": "./dist/linters/index.js"
80
+ },
81
+ "./tsconfig.base.json": "./src/tsconfig/tsconfig.base.json",
82
+ "./tsconfig.common.json": "./src/tsconfig/tsconfig.common.json",
83
+ "./tsconfig.browser.json": "./src/tsconfig/tsconfig.browser.json",
84
+ "./tsconfig.react.json": "./src/tsconfig/tsconfig.react.json",
69
85
  "./package.json": "./package.json"
70
86
  },
71
87
  "files": [
72
88
  "README.md",
73
89
  "LICENSE.md",
74
90
  "dist",
75
- "tsconfig",
91
+ "src/tsconfig",
76
92
  "!**/*.tsbuildinfo"
77
93
  ],
78
94
  "publishConfig": {
@@ -80,22 +96,21 @@
80
96
  },
81
97
  "scripts": {
82
98
  "force-update": "sh ./scripts/force-update.sh",
83
- "build": "sh ./scripts/build.sh",
84
- "clean": "sh ./scripts/clean.sh",
85
- "eslint": "eslint --report-unused-disable-directives .",
86
- "lint": "bun run eslint && bun run prettier:cli",
87
- "lint:fix": "bun run eslint --fix && bun run prettier:fix",
88
- "prettier:cli": "prettier \"**/*.{js,ts}\" -l",
89
- "prettier:fix": "bun run prettier:cli --write",
90
- "rebuild": "sh ./scripts/rebuild.sh no-version",
91
- "prepublishOnly": "bun run rebuild"
99
+ "prepublishOnly": "make rebuild"
92
100
  },
93
101
  "dependencies": {
94
- "@minimaltech/eslint-node": "^0.3.0",
95
- "eslint-plugin-unicorn": "^74.0.0"
102
+ "@eslint/js": "^10.0.1",
103
+ "eslint-config-prettier": "^10.1.8",
104
+ "eslint-plugin-n": "^18.2.1",
105
+ "eslint-plugin-prettier": "^5.5.6",
106
+ "eslint-plugin-unicorn": "^74.0.0",
107
+ "typescript-eslint": "^8.71.2"
96
108
  },
97
109
  "peerDependencies": {
98
110
  "eslint": "^9.0.0 || ^10.0.0",
111
+ "oxfmt": ">=0.73.0",
112
+ "oxlint": ">=1.88.0",
113
+ "oxlint-tsgolint": ">=7.0.2004",
99
114
  "prettier": "^3.0.0",
100
115
  "typescript": "^5.0.0 || ^6.0.0"
101
116
  },
@@ -103,6 +118,15 @@
103
118
  "eslint": {
104
119
  "optional": true
105
120
  },
121
+ "oxfmt": {
122
+ "optional": true
123
+ },
124
+ "oxlint": {
125
+ "optional": true
126
+ },
127
+ "oxlint-tsgolint": {
128
+ "optional": true
129
+ },
106
130
  "prettier": {
107
131
  "optional": true
108
132
  },
@@ -113,6 +137,9 @@
113
137
  "devDependencies": {
114
138
  "@types/bun": "^1.4.1",
115
139
  "eslint": "^10.10.0",
140
+ "oxfmt": "0.73.0",
141
+ "oxlint": "1.88.0",
142
+ "oxlint-tsgolint": "7.0.2004",
116
143
  "prettier": "^3.9.6",
117
144
  "typescript": "^6.0.3"
118
145
  }
@@ -5,8 +5,8 @@
5
5
  "ignoreDeprecations": "6.0",
6
6
 
7
7
  /* Language and Environment */
8
- "target": "ES2024",
9
- "lib": ["ES2024"],
8
+ "target": "ES2025",
9
+ "lib": ["ES2025"],
10
10
  "types": ["bun"],
11
11
  "experimentalDecorators": true,
12
12
  "emitDecoratorMetadata": true,
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "http://json.schemastore.org/tsconfig",
3
+ "extends": "./tsconfig.base.json",
4
+ "compilerOptions": {
5
+ /* A browser library: a bundler (Vite, webpack) resolves the imports, the DOM is there, Bun is not */
6
+ "lib": ["ES2025", "DOM", "DOM.Iterable"],
7
+ "types": [],
8
+ "module": "ESNext",
9
+ "moduleResolution": "bundler"
10
+ }
11
+ }
@@ -2,7 +2,7 @@
2
2
  "$schema": "http://json.schemastore.org/tsconfig",
3
3
  "extends": "./tsconfig.base.json",
4
4
  "compilerOptions": {
5
- "target": "ES2024",
5
+ "target": "ES2025",
6
6
  "module": "nodenext",
7
7
  "moduleResolution": "nodenext"
8
8
  },
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "http://json.schemastore.org/tsconfig",
3
+ "extends": "./tsconfig.browser.json",
4
+ "compilerOptions": {
5
+ "jsx": "react-jsx"
6
+ }
7
+ }
@@ -1 +0,0 @@
1
- {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../src/compile.ts"],"names":[],"mappings":"AAIA,gHAAgH;AAChH,qBAAa,WAAW;IACtB;;;;OAIG;WACU,OAAO,CAClB,IAAI,GAAE;QACJ,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC;KACtB,GACL,OAAO,CAAC,IAAI,CAAC;CAiCjB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"compile.js","sourceRoot":"","sources":["../src/compile.ts"],"names":[],"mappings":";;;AAAA,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAC7C,MAAM,eAAe,GAAG,YAAY,CAAC;AACrC,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAE/C,gHAAgH;AAChH,MAAa,WAAW;IACtB;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,OAAO,CAClB,OAKI,EAAE;QAEN,MAAM,EACJ,UAAU,GAAG,kBAAkB,EAC/B,OAAO,GAAG,eAAe,EACzB,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,UAAU,IAAI,sBAAsB,EACrD,OAAO,GAAG,EAAE,GACb,GAAG,IAAI,CAAC;QAET,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC;YAC5B,WAAW,EAAE,CAAC,UAAU,CAAC;YACzB,MAAM,EAAE,KAAK;YACb,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;YAC1C,SAAS,EAAE,QAAQ;YACnB,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE;gBACP,iIAAiI;gBACjI,MAAM,EAAE,MAAiC;gBACzC,OAAO;aACR;YACD,OAAO;SACR,CAAC,CAAC;QAEH,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACnB,4FAA4F;YAC5F,8FAA8F;YAC9F,MAAM,IAAI,KAAK,CACb;gBACE,gDAAgD,UAAU,IAAI;gBAC9D,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC;aAC5D,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AA9CD,kCA8CC"}
package/dist/eslint.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import type { Linter } from "eslint";
2
- export declare const eslintConfigs: Linter.Config[];
3
- //# sourceMappingURL=eslint.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eslint.d.ts","sourceRoot":"","sources":["../src/eslint.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAexC,CAAC"}
package/dist/eslint.js DELETED
@@ -1,25 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.eslintConfigs = void 0;
7
- const eslint_node_1 = __importDefault(require("@minimaltech/eslint-node"));
8
- const eslint_plugin_unicorn_1 = __importDefault(require("eslint-plugin-unicorn"));
9
- exports.eslintConfigs = [
10
- ...eslint_node_1.default,
11
- {
12
- rules: {
13
- "@typescript-eslint/no-explicit-any": "off",
14
- "@typescript-eslint/ban-ts-comment": "error",
15
- "@typescript-eslint/no-namespace": "error",
16
- },
17
- },
18
- {
19
- plugins: { unicorn: eslint_plugin_unicorn_1.default },
20
- rules: {
21
- "unicorn/switch-case-braces": ["error", "always"],
22
- },
23
- },
24
- ];
25
- //# sourceMappingURL=eslint.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eslint.js","sourceRoot":"","sources":["../src/eslint.ts"],"names":[],"mappings":";;;;;;AAAA,2EAAqD;AAErD,kFAA4C;AAE/B,QAAA,aAAa,GAAoB;IAC5C,GAAG,qBAAa;IAChB;QACE,KAAK,EAAE;YACL,oCAAoC,EAAE,KAAK;YAC3C,mCAAmC,EAAE,OAAO;YAC5C,iCAAiC,EAAE,OAAO;SAC3C;KACF;IACD;QACE,OAAO,EAAE,EAAE,OAAO,EAAP,+BAAO,EAAE;QACpB,KAAK,EAAE;YACL,4BAA4B,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;SAClD;KACF;CACF,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { Config } from "prettier";
2
- export declare const prettierConfigs: Config;
3
- //# sourceMappingURL=prettier.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prettier.d.ts","sourceRoot":"","sources":["../src/prettier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,eAAO,MAAM,eAAe,EAAE,MAQ7B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"prettier.js","sourceRoot":"","sources":["../src/prettier.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAAW;IACrC,cAAc,EAAE,IAAI;IACpB,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,GAAG;IACf,QAAQ,EAAE,CAAC;IACX,aAAa,EAAE,KAAK;IACpB,WAAW,EAAE,OAAO;IACpB,IAAI,EAAE,IAAI;CACX,CAAC"}
package/dist/react.d.ts DELETED
@@ -1,32 +0,0 @@
1
- import type { ESLint, Linter } from "eslint";
2
- /** Without `configs`: each plugin types its presets its own way, and only the rules are used here. */
3
- type TRulesPlugin = Omit<ESLint.Plugin, "configs">;
4
- export interface IReactEslintPlugins {
5
- react: TRulesPlugin;
6
- reactHooks: TRulesPlugin;
7
- jsxA11y: TRulesPlugin;
8
- }
9
- /**
10
- * The base preset plus what a React frontend needs on top: the React, hooks and accessibility rules,
11
- * and the base rules a UI relaxes on purpose. The plugins come in as options, so a backend that
12
- * never calls this installs none of them.
13
- *
14
- * ```js
15
- * import react from 'eslint-plugin-react';
16
- * import reactHooks from 'eslint-plugin-react-hooks';
17
- * import jsxA11y from 'eslint-plugin-jsx-a11y';
18
- *
19
- * export default ReactEslintConfigs.create({ plugins: { react, reactHooks, jsxA11y } });
20
- * ```
21
- *
22
- * `reactVersion` defaults to `detect`. Under ESLint 10, eslint-plugin-react 7 cannot detect it and
23
- * aborts, so pass the version there (`reactVersion: '19.2'`).
24
- */
25
- export declare class ReactEslintConfigs {
26
- static create(opts: {
27
- plugins: IReactEslintPlugins;
28
- reactVersion?: string;
29
- }): Linter.Config[];
30
- }
31
- export {};
32
- //# sourceMappingURL=react.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAG7C,sGAAsG;AACtG,KAAK,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAEnD,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,YAAY,CAAC;IACpB,UAAU,EAAE,YAAY,CAAC;IACzB,OAAO,EAAE,YAAY,CAAC;CACvB;AAID;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,kBAAkB;IAC7B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;QAClB,OAAO,EAAE,mBAAmB,CAAC;QAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,GAAG,MAAM,CAAC,MAAM,EAAE;CA+FpB"}
package/dist/react.js DELETED
@@ -1,111 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ReactEslintConfigs = void 0;
4
- const eslint_1 = require("./eslint");
5
- const NAMING_CONVENTION = "@typescript-eslint/naming-convention";
6
- /**
7
- * The base preset plus what a React frontend needs on top: the React, hooks and accessibility rules,
8
- * and the base rules a UI relaxes on purpose. The plugins come in as options, so a backend that
9
- * never calls this installs none of them.
10
- *
11
- * ```js
12
- * import react from 'eslint-plugin-react';
13
- * import reactHooks from 'eslint-plugin-react-hooks';
14
- * import jsxA11y from 'eslint-plugin-jsx-a11y';
15
- *
16
- * export default ReactEslintConfigs.create({ plugins: { react, reactHooks, jsxA11y } });
17
- * ```
18
- *
19
- * `reactVersion` defaults to `detect`. Under ESLint 10, eslint-plugin-react 7 cannot detect it and
20
- * aborts, so pass the version there (`reactVersion: '19.2'`).
21
- */
22
- class ReactEslintConfigs {
23
- static create(opts) {
24
- const { react, reactHooks, jsxA11y } = opts.plugins;
25
- const { reactVersion = "detect" } = opts;
26
- // The last config that sets it wins, as in ESLint itself.
27
- const baseNaming = [...eslint_1.eslintConfigs]
28
- .reverse()
29
- .find((config) => config.rules?.[NAMING_CONVENTION])?.rules?.[NAMING_CONVENTION];
30
- // A bare severity carries no selectors; nothing to extend then but the severity.
31
- const [severity, ...selectors] = Array.isArray(baseNaming) ? baseNaming : [baseNaming ?? "error"];
32
- return [
33
- ...eslint_1.eslintConfigs,
34
- {
35
- files: ["**/*.{jsx,tsx}"],
36
- plugins: { react, "jsx-a11y": jsxA11y },
37
- settings: { react: { version: reactVersion } },
38
- rules: {
39
- // The base naming rule, plus PascalCase functions: a component declared as `function App()`.
40
- [NAMING_CONVENTION]: [
41
- severity,
42
- ...selectors,
43
- { selector: "function", format: ["camelCase", "PascalCase"] },
44
- ],
45
- // Correctness rules from react's recommended set. Left out: what the automatic JSX runtime or
46
- // tsc already covers (react-in-jsx-scope, jsx-uses-react, prop-types, jsx-no-undef,
47
- // jsx-no-duplicate-props, no-unknown-property).
48
- "react/display-name": "error",
49
- "react/jsx-boolean-value": "error",
50
- "react/jsx-key": "error",
51
- "react/jsx-no-comment-textnodes": "error",
52
- "react/jsx-no-target-blank": "error",
53
- "react/no-children-prop": "error",
54
- "react/no-danger-with-children": "error",
55
- "react/no-deprecated": "error",
56
- "react/no-direct-mutation-state": "error",
57
- "react/no-find-dom-node": "error",
58
- "react/no-is-mounted": "error",
59
- "react/no-render-return-value": "error",
60
- "react/no-string-refs": "error",
61
- "react/require-render-return": "error",
62
- "jsx-a11y/alt-text": "error",
63
- "jsx-a11y/anchor-has-content": "error",
64
- "jsx-a11y/aria-props": "error",
65
- "jsx-a11y/aria-proptypes": "error",
66
- "jsx-a11y/aria-role": "error",
67
- "jsx-a11y/aria-unsupported-elements": "error",
68
- "jsx-a11y/role-has-required-aria-props": "error",
69
- "jsx-a11y/role-supports-aria-props": "error",
70
- "jsx-a11y/tabindex-no-positive": "error",
71
- },
72
- },
73
- {
74
- // Custom hooks live in .ts files too.
75
- files: ["**/*.{js,jsx,ts,tsx}"],
76
- plugins: { "react-hooks": reactHooks },
77
- rules: {
78
- "react-hooks/rules-of-hooks": "error",
79
- "react-hooks/exhaustive-deps": "warn",
80
- },
81
- },
82
- {
83
- rules: {
84
- "@typescript-eslint/consistent-type-imports": [
85
- "error",
86
- { prefer: "type-imports" },
87
- ],
88
- // A UI hands promises to event handlers and effects that do not await them.
89
- "@typescript-eslint/no-floating-promises": "off",
90
- "no-void": "off",
91
- // Function components, not classes; a component may be used above its declaration.
92
- "@typescript-eslint/no-invalid-this": "off",
93
- "@typescript-eslint/no-use-before-define": "off",
94
- "@typescript-eslint/no-explicit-any": "warn",
95
- "@typescript-eslint/no-shadow": "warn",
96
- "@typescript-eslint/no-unused-vars": [
97
- "warn",
98
- {
99
- argsIgnorePattern: "^_",
100
- varsIgnorePattern: "^_",
101
- caughtErrorsIgnorePattern: "^_",
102
- ignoreRestSiblings: true,
103
- },
104
- ],
105
- },
106
- },
107
- ];
108
- }
109
- }
110
- exports.ReactEslintConfigs = ReactEslintConfigs;
111
- //# sourceMappingURL=react.js.map
package/dist/react.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":";;;AACA,qCAAyC;AAWzC,MAAM,iBAAiB,GAAG,sCAAsC,CAAC;AAEjE;;;;;;;;;;;;;;;GAeG;AACH,MAAa,kBAAkB;IAC7B,MAAM,CAAC,MAAM,CAAC,IAGb;QACC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QACpD,MAAM,EAAE,YAAY,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC;QAEzC,0DAA0D;QAC1D,MAAM,UAAU,GAAG,CAAC,GAAG,sBAAa,CAAC;aAClC,OAAO,EAAE;aACT,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,CAC7D,iBAAiB,CAClB,CAAC;QACF,iFAAiF;QACjF,MAAM,CAAC,QAAQ,EAAE,GAAG,SAA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