@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
@@ -0,0 +1,178 @@
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.reactNamingConventionConfigs = exports.ReactOxlintConfigs = exports.ReactEslintConfigs = void 0;
7
+ const typescript_eslint_1 = __importDefault(require("typescript-eslint"));
8
+ const browser_1 = require("./browser");
9
+ const eslint_1 = require("./eslint");
10
+ const rules_1 = require("./rules");
11
+ /**
12
+ * The base preset plus what a React frontend needs on top: the React, hooks and accessibility rules.
13
+ * Frontend code is held to the backend's standard - no floating promise, no `void`, no use before
14
+ * declaration - so nothing in the base is relaxed. The plugins come in as options, so a backend that
15
+ * never calls this installs none of them.
16
+ *
17
+ * ```js
18
+ * import react from 'eslint-plugin-react';
19
+ * import reactHooks from 'eslint-plugin-react-hooks';
20
+ * import jsxA11y from 'eslint-plugin-jsx-a11y';
21
+ *
22
+ * export default ReactEslintConfigs.create({ plugins: { react, reactHooks, jsxA11y } });
23
+ * ```
24
+ *
25
+ * `reactVersion` defaults to `detect`. Under ESLint 10, eslint-plugin-react 7 cannot detect it and
26
+ * aborts, so pass the version there (`reactVersion: '19.2'`).
27
+ */
28
+ class ReactEslintConfigs {
29
+ static create(opts) {
30
+ const { react, reactHooks, jsxA11y } = opts.plugins;
31
+ const { reactVersion = 'detect' } = opts;
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
+ [rules_1.NamingConventionRule.NAME]: rules_1.NamingConventionRule.build({
41
+ extraSelectors: [{ selector: 'function', format: ['camelCase', 'PascalCase'] }],
42
+ }),
43
+ // Correctness rules from react's recommended set. Left out: what the automatic JSX runtime or
44
+ // tsc already covers (react-in-jsx-scope, jsx-uses-react, prop-types, jsx-no-undef,
45
+ // jsx-no-duplicate-props, no-unknown-property).
46
+ 'react/display-name': 'error',
47
+ 'react/jsx-boolean-value': 'error',
48
+ 'react/jsx-key': 'error',
49
+ 'react/jsx-no-comment-textnodes': 'error',
50
+ 'react/jsx-no-target-blank': 'error',
51
+ 'react/no-children-prop': 'error',
52
+ 'react/no-danger-with-children': 'error',
53
+ 'react/no-deprecated': 'error',
54
+ 'react/no-direct-mutation-state': 'error',
55
+ 'react/no-find-dom-node': 'error',
56
+ 'react/no-is-mounted': 'error',
57
+ 'react/no-render-return-value': 'error',
58
+ 'react/no-string-refs': 'error',
59
+ 'react/require-render-return': 'error',
60
+ 'jsx-a11y/alt-text': 'error',
61
+ 'jsx-a11y/anchor-has-content': 'error',
62
+ 'jsx-a11y/aria-props': 'error',
63
+ 'jsx-a11y/aria-proptypes': 'error',
64
+ 'jsx-a11y/aria-role': 'error',
65
+ 'jsx-a11y/aria-unsupported-elements': 'error',
66
+ 'jsx-a11y/role-has-required-aria-props': 'error',
67
+ 'jsx-a11y/role-supports-aria-props': 'error',
68
+ 'jsx-a11y/tabindex-no-positive': 'error',
69
+ },
70
+ },
71
+ {
72
+ // Custom hooks live in .ts files too.
73
+ files: ['**/*.{js,jsx,ts,tsx}'],
74
+ plugins: { 'react-hooks': reactHooks },
75
+ rules: {
76
+ 'react-hooks/rules-of-hooks': 'error',
77
+ 'react-hooks/exhaustive-deps': 'error',
78
+ },
79
+ },
80
+ {
81
+ rules: {
82
+ '@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }],
83
+ [rules_1.NoRestrictedPropertiesRule.NAME]: rules_1.NoRestrictedPropertiesRule.build(),
84
+ },
85
+ },
86
+ ];
87
+ }
88
+ }
89
+ exports.ReactEslintConfigs = ReactEslintConfigs;
90
+ const JSX_FILES = ['**/*.jsx', '**/*.tsx'];
91
+ const SOURCE_FILES = ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts'];
92
+ /** A component is declared as `function App()`, so functions may be PascalCase too. */
93
+ const COMPONENT_FUNCTION_SELECTOR = { selector: 'function', format: ['camelCase', 'PascalCase'] };
94
+ /**
95
+ * The oxlint counterpart of `ReactEslintConfigs`: `BrowserOxlintConfigs` (the base rules plus the
96
+ * secure-context ban) plus the React, hooks and accessibility rules and `consistent-type-imports`.
97
+ * oxlint runs these plugins natively, so nothing is passed in. `react/no-deprecated` has no oxlint
98
+ * port and is left out.
99
+ *
100
+ * Nothing in the base is relaxed - frontend code meets the backend's standard - and
101
+ * `exhaustive-deps` is an error.
102
+ *
103
+ * ```ts
104
+ * // .configs/oxlint.config.mts
105
+ * import { defineConfig } from 'oxlint';
106
+ * import { ReactOxlintConfigs } from '@venizia/dev-configs/linters';
107
+ *
108
+ * export default defineConfig(ReactOxlintConfigs.create());
109
+ * ```
110
+ */
111
+ class ReactOxlintConfigs {
112
+ static create() {
113
+ const browserConfigs = browser_1.BrowserOxlintConfigs.create();
114
+ return {
115
+ ...browserConfigs,
116
+ plugins: [...new Set([...(browserConfigs.plugins ?? []), 'react', 'jsx-a11y'])],
117
+ overrides: [
118
+ ...(browserConfigs.overrides ?? []),
119
+ {
120
+ files: JSX_FILES,
121
+ rules: {
122
+ // Correctness rules from react's recommended set, as in ReactEslintConfigs.
123
+ 'react/display-name': 'error',
124
+ 'react/jsx-boolean-value': 'error',
125
+ 'react/jsx-key': 'error',
126
+ 'react/jsx-no-comment-textnodes': 'error',
127
+ 'react/jsx-no-target-blank': 'error',
128
+ 'react/no-children-prop': 'error',
129
+ 'react/no-danger-with-children': 'error',
130
+ 'react/no-direct-mutation-state': 'error',
131
+ 'react/no-find-dom-node': 'error',
132
+ 'react/no-is-mounted': 'error',
133
+ 'react/no-render-return-value': 'error',
134
+ 'react/no-string-refs': 'error',
135
+ 'react/require-render-return': 'error',
136
+ 'jsx-a11y/alt-text': 'error',
137
+ 'jsx-a11y/anchor-has-content': 'error',
138
+ 'jsx-a11y/aria-props': 'error',
139
+ 'jsx-a11y/aria-proptypes': 'error',
140
+ 'jsx-a11y/aria-role': 'error',
141
+ 'jsx-a11y/aria-unsupported-elements': 'error',
142
+ 'jsx-a11y/role-has-required-aria-props': 'error',
143
+ 'jsx-a11y/role-supports-aria-props': 'error',
144
+ 'jsx-a11y/tabindex-no-positive': 'error',
145
+ },
146
+ },
147
+ {
148
+ // Custom hooks live in .ts files too.
149
+ files: SOURCE_FILES,
150
+ rules: {
151
+ 'react/rules-of-hooks': 'error',
152
+ 'react/exhaustive-deps': 'error',
153
+ 'typescript/consistent-type-imports': ['error', { prefer: 'type-imports' }],
154
+ },
155
+ },
156
+ ],
157
+ };
158
+ }
159
+ }
160
+ exports.ReactOxlintConfigs = ReactOxlintConfigs;
161
+ /**
162
+ * `namingConventionConfigs` for a React project: the base rule plus PascalCase functions in .jsx and
163
+ * .tsx files, where a component is declared as `function App()`.
164
+ */
165
+ exports.reactNamingConventionConfigs = [
166
+ ...eslint_1.namingConventionConfigs,
167
+ {
168
+ files: JSX_FILES,
169
+ languageOptions: { parser: typescript_eslint_1.default.parser },
170
+ plugins: { '@typescript-eslint': typescript_eslint_1.default.plugin },
171
+ rules: {
172
+ [rules_1.NamingConventionRule.NAME]: rules_1.NamingConventionRule.build({
173
+ extraSelectors: [COMPONENT_FUNCTION_SELECTOR],
174
+ }),
175
+ },
176
+ },
177
+ ];
178
+ //# sourceMappingURL=react.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.js","sourceRoot":"","sources":["../../src/linters/react.ts"],"names":[],"mappings":";;;;;;AAEA,0EAAyC;AACzC,uCAAiD;AACjD,qCAAkE;AAClE,mCAA2E;AAW3E;;;;;;;;;;;;;;;;GAgBG;AACH,MAAa,kBAAkB;IAC7B,MAAM,CAAC,MAAM,CAAC,IAA6D;QACzE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QACpD,MAAM,EAAE,YAAY,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC;QAEzC,OAAO;YACL,GAAG,sBAAa;YAChB;gBACE,KAAK,EAAE,CAAC,gBAAgB,CAAC;gBACzB,OAAO,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE;gBACvC,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE;gBAC9C,KAAK,EAAE;oBACL,6FAA6F;oBAC7F,CAAC,4BAAoB,CAAC,IAAI,CAAC,EAAE,4BAAo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B,yBAAyB,EAAE,OAAO;wBAClC,oBAAoB,EAAE,OAAO;wBAC7B,oCAAoC,EAAE,OAAO;wBAC7C,uCAAuC,EAAE,OAAO;wBAChD,mCAAmC,EAAE,OAAO;wBAC5C,+BAA+B,EAAE,OAAO;qBACzC;iBACF;gBACD;oBACE,sCAAsC;oBACtC,KAAK,EAAE,YAAY;oBACnB,KAAK,EAAE;wBACL,sBAAsB,EAAE,OAAO;wBAC/B,uBAAuB,EAAE,OAAO;wBAChC,oCAAoC,EAAE,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;qBAC5E;iBACF;aACF;SACF,CAAC;IACJ,CAAC;CACF;AAlDD,gDAkDC;AAED;;;GAGG;AACU,QAAA,4BAA4B,GAAoB;IAC3D,GAAG,gCAAuB;IAC1B;QACE,KAAK,EAAE,SAAS;QAChB,eAAe,EAAE,EAAE,MAAM,EAAE,2BAAQ,CAAC,MAAuB,EAAE;QAC7D,OAAO,EAAE,EAAE,oBAAoB,EAAE,2BAAQ,CAAC,MAAe,EAAE;QAC3D,KAAK,EAAE;YACL,CAAC,4BAAoB,CAAC,IAAI,CAAC,EAAE,4BAAoB,CAAC,KAAK,CAAC;gBACtD,cAAc,EAAE,CAAC,2BAA2B,CAAC;aAC9C,CAAC;SACH;KACF;CACF,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { OxlintConfig } from 'oxlint';
2
+ /** A rule's severity, as both oxlint and ESLint accept it. */
3
+ export type TRuleSeverity = 'off' | 'warn' | 'error';
4
+ /** The entry oxlint's own types allow for rule `TName`, options included. */
5
+ export type TOxlintRuleEntry<TName extends string> = NonNullable<NonNullable<OxlintConfig['rules']>[TName]>;
6
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/linters/rules/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAE3C,8DAA8D;AAC9D,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;AAErD,6EAA6E;AAC7E,MAAM,MAAM,gBAAgB,CAAC,KAAK,SAAS,MAAM,IAAI,WAAW,CAC9D,WAAW,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAC1C,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/linters/rules/common.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import type { TOxlintRuleEntry, TRuleSeverity } from './common';
2
+ /** `eqeqeq`. `smart` still allows `== null` and comparing two literals. */
3
+ export declare class EqeqeqRule {
4
+ static readonly NAME = "eqeqeq";
5
+ static build(opts?: {
6
+ severity?: TRuleSeverity;
7
+ mode?: 'always' | 'smart';
8
+ }): TOxlintRuleEntry<'eqeqeq'>;
9
+ }
10
+ //# sourceMappingURL=eqeqeq.rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eqeqeq.rule.d.ts","sourceRoot":"","sources":["../../../src/linters/rules/eqeqeq.rule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEhE,2EAA2E;AAC3E,qBAAa,UAAU;IACrB,MAAM,CAAC,QAAQ,CAAC,IAAI,YAAY;IAEhC,MAAM,CAAC,KAAK,CACV,IAAI,GAAE;QAAE,QAAQ,CAAC,EAAE,aAAa,CAAC;QAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;KAAO,GACjE,gBAAgB,CAAC,QAAQ,CAAC;CAI9B"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EqeqeqRule = void 0;
4
+ /** `eqeqeq`. `smart` still allows `== null` and comparing two literals. */
5
+ class EqeqeqRule {
6
+ static { this.NAME = 'eqeqeq'; }
7
+ static build(opts = {}) {
8
+ const { severity = 'error', mode = 'smart' } = opts;
9
+ return [severity, mode];
10
+ }
11
+ }
12
+ exports.EqeqeqRule = EqeqeqRule;
13
+ //# sourceMappingURL=eqeqeq.rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eqeqeq.rule.js","sourceRoot":"","sources":["../../../src/linters/rules/eqeqeq.rule.ts"],"names":[],"mappings":";;;AAEA,2EAA2E;AAC3E,MAAa,UAAU;aACL,SAAI,GAAG,QAAQ,CAAC;IAEhC,MAAM,CAAC,KAAK,CACV,OAAgE,EAAE;QAElE,MAAM,EAAE,QAAQ,GAAG,OAAO,EAAE,IAAI,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC;QACpD,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC1B,CAAC;;AARH,gCASC"}
@@ -0,0 +1,9 @@
1
+ export * from './common';
2
+ export * from './eqeqeq.rule';
3
+ export * from './naming-convention.rule';
4
+ export * from './no-restricted-imports.rule';
5
+ export * from './no-restricted-properties.rule';
6
+ export * from './no-unused-vars.rule';
7
+ export * from './prefer-nullish-coalescing.rule';
8
+ export * from './switch-case-braces.rule';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/linters/rules/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC;AACtC,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./common"), exports);
18
+ __exportStar(require("./eqeqeq.rule"), exports);
19
+ __exportStar(require("./naming-convention.rule"), exports);
20
+ __exportStar(require("./no-restricted-imports.rule"), exports);
21
+ __exportStar(require("./no-restricted-properties.rule"), exports);
22
+ __exportStar(require("./no-unused-vars.rule"), exports);
23
+ __exportStar(require("./prefer-nullish-coalescing.rule"), exports);
24
+ __exportStar(require("./switch-case-braces.rule"), exports);
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/linters/rules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,gDAA8B;AAC9B,2DAAyC;AACzC,+DAA6C;AAC7C,kEAAgD;AAChD,wDAAsC;AACtC,mEAAiD;AACjD,4DAA0C"}
@@ -0,0 +1,20 @@
1
+ import type { Linter } from 'eslint';
2
+ import type { TRuleSeverity } from './common';
3
+ /** One selector of `@typescript-eslint/naming-convention`, as its documentation types it. */
4
+ export type TNamingSelector = Record<string, unknown> & {
5
+ selector: string | string[];
6
+ };
7
+ /**
8
+ * `@typescript-eslint/naming-convention`, owned here. oxlint has no port of it, so it runs in ESLint.
9
+ * The selectors are the LoopBack 4 set the base preset carried, kept one for one.
10
+ */
11
+ export declare class NamingConventionRule {
12
+ static readonly NAME = "@typescript-eslint/naming-convention";
13
+ static readonly SELECTORS: readonly TNamingSelector[];
14
+ /** `extraSelectors` go last, so they win over a base selector they overlap. */
15
+ static build(opts?: {
16
+ severity?: TRuleSeverity;
17
+ extraSelectors?: TNamingSelector[];
18
+ }): Linter.RuleEntry;
19
+ }
20
+ //# sourceMappingURL=naming-convention.rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"naming-convention.rule.d.ts","sourceRoot":"","sources":["../../../src/linters/rules/naming-convention.rule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,6FAA6F;AAC7F,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAAE,CAAC;AAExF;;;GAGG;AACH,qBAAa,oBAAoB;IAC/B,MAAM,CAAC,QAAQ,CAAC,IAAI,0CAA0C;IAE9D,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,CA8CnD;IAEF,+EAA+E;IAC/E,MAAM,CAAC,KAAK,CACV,IAAI,GAAE;QAAE,QAAQ,CAAC,EAAE,aAAa,CAAC;QAAC,cAAc,CAAC,EAAE,eAAe,EAAE,CAAA;KAAO,GAC1E,MAAM,CAAC,SAAS;CAIpB"}
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NamingConventionRule = void 0;
4
+ /**
5
+ * `@typescript-eslint/naming-convention`, owned here. oxlint has no port of it, so it runs in ESLint.
6
+ * The selectors are the LoopBack 4 set the base preset carried, kept one for one.
7
+ */
8
+ class NamingConventionRule {
9
+ static { this.NAME = '@typescript-eslint/naming-convention'; }
10
+ static { this.SELECTORS = [
11
+ { selector: 'default', format: ['camelCase'] },
12
+ { selector: 'variable', format: ['camelCase', 'UPPER_CASE', 'PascalCase'] },
13
+ { selector: 'variable', format: null, filter: '^_$' },
14
+ { selector: 'function', format: ['PascalCase'], filter: 'Mixin$' },
15
+ { selector: 'parameter', format: ['camelCase'], leadingUnderscore: 'allow' },
16
+ {
17
+ selector: 'enumMember',
18
+ format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
19
+ leadingUnderscore: 'allow',
20
+ },
21
+ {
22
+ selector: 'property',
23
+ format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
24
+ leadingUnderscore: 'allow',
25
+ },
26
+ { selector: 'method', format: ['camelCase'], leadingUnderscore: 'allow' },
27
+ { selector: 'memberLike', modifiers: ['static'], format: ['camelCase', 'UPPER_CASE'] },
28
+ {
29
+ selector: 'memberLike',
30
+ modifiers: ['private'],
31
+ format: ['camelCase'],
32
+ leadingUnderscore: 'allow',
33
+ },
34
+ {
35
+ selector: 'memberLike',
36
+ modifiers: ['protected'],
37
+ format: ['camelCase'],
38
+ leadingUnderscore: 'allow',
39
+ },
40
+ { selector: 'typeLike', format: ['PascalCase'] },
41
+ {
42
+ selector: [
43
+ 'objectLiteralProperty',
44
+ 'objectLiteralMethod',
45
+ 'typeProperty',
46
+ 'typeMethod',
47
+ 'classProperty',
48
+ 'classMethod',
49
+ 'enumMember',
50
+ ],
51
+ format: null,
52
+ modifiers: ['requiresQuotes'],
53
+ },
54
+ { selector: 'import', format: ['camelCase', 'PascalCase'] },
55
+ { selector: 'import', format: null, filter: '^_$' },
56
+ ]; }
57
+ /** `extraSelectors` go last, so they win over a base selector they overlap. */
58
+ static build(opts = {}) {
59
+ const { severity = 'error', extraSelectors = [] } = opts;
60
+ return [severity, ...NamingConventionRule.SELECTORS, ...extraSelectors];
61
+ }
62
+ }
63
+ exports.NamingConventionRule = NamingConventionRule;
64
+ //# sourceMappingURL=naming-convention.rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"naming-convention.rule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AE,YAAY;YACtB,SAAS,EAAE,CAAC,WAAW,CAAC;YACxB,MAAM,EAAE,CAAC,WAAW,CAAC;YACrB,iBAAiB,EAAE,OAAO;SAC3B;QACD,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,YAAY,CAAC,EAAE;QAChD;YACE,QAAQ,EAAE;gBACR,uBAAuB;gBACvB,qBAAqB;gBACrB,cAAc;gBACd,YAAY;gBACZ,eAAe;gBACf,aAAa;gBACb,YAAY;aACb;YACD,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE,CAAC,gBAAgB,CAAC;SAC9B;QACD,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC,EAAE;QAC3D,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE;KACpD,CAAC;IAEF,+EAA+E;IAC/E,MAAM,CAAC,KAAK,CACV,OAAyE,EAAE;QAE3E,MAAM,EAAE,QAAQ,GAAG,OAAO,EAAE,cAAc,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC;QACzD,OAAO,CAAC,QAAQ,EAAE,GAAG,oBAAoB,CAAC,SAAS,EAAE,GAAG,cAAc,CAAC,CAAC;IAC1E,CAAC;;AAzDH,oDA0DC"}
@@ -0,0 +1,17 @@
1
+ import type { TOxlintRuleEntry, TRuleSeverity } from './common';
2
+ /** One forbidden import path, with the message the author sees. */
3
+ export interface IRestrictedImportPath {
4
+ name: string;
5
+ message: string;
6
+ importNames?: string[];
7
+ }
8
+ /** `no-restricted-imports`. The base forbids the whole of lodash, which defeats tree-shaking. */
9
+ export declare class NoRestrictedImportsRule {
10
+ static readonly NAME = "no-restricted-imports";
11
+ static readonly PATHS: readonly IRestrictedImportPath[];
12
+ static build(opts?: {
13
+ severity?: TRuleSeverity;
14
+ extraPaths?: IRestrictedImportPath[];
15
+ }): TOxlintRuleEntry<'no-restricted-imports'>;
16
+ }
17
+ //# sourceMappingURL=no-restricted-imports.rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-restricted-imports.rule.d.ts","sourceRoot":"","sources":["../../../src/linters/rules/no-restricted-imports.rule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEhE,mEAAmE;AACnE,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,iGAAiG;AACjG,qBAAa,uBAAuB;IAClC,MAAM,CAAC,QAAQ,CAAC,IAAI,2BAA2B;IAE/C,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,qBAAqB,EAAE,CAMrD;IAEF,MAAM,CAAC,KAAK,CACV,IAAI,GAAE;QAAE,QAAQ,CAAC,EAAE,aAAa,CAAC;QAAC,UAAU,CAAC,EAAE,qBAAqB,EAAE,CAAA;KAAO,GAC5E,gBAAgB,CAAC,uBAAuB,CAAC;CAI7C"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NoRestrictedImportsRule = void 0;
4
+ /** `no-restricted-imports`. The base forbids the whole of lodash, which defeats tree-shaking. */
5
+ class NoRestrictedImportsRule {
6
+ static { this.NAME = 'no-restricted-imports'; }
7
+ static { this.PATHS = [
8
+ {
9
+ name: 'lodash',
10
+ message: "Please import 'fn' from 'lodash/fn' instead of * from lodash | Ex: import get from 'lodash/get'",
11
+ },
12
+ ]; }
13
+ static build(opts = {}) {
14
+ const { severity = 'error', extraPaths = [] } = opts;
15
+ return [severity, { paths: [...NoRestrictedImportsRule.PATHS, ...extraPaths] }];
16
+ }
17
+ }
18
+ exports.NoRestrictedImportsRule = NoRestrictedImportsRule;
19
+ //# sourceMappingURL=no-restricted-imports.rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-restricted-imports.rule.js","sourceRoot":"","sources":["../../../src/linters/rules/no-restricted-imports.rule.ts"],"names":[],"mappings":";;;AASA,iGAAiG;AACjG,MAAa,uBAAuB;aAClB,SAAI,GAAG,uBAAuB,CAAC;aAE/B,UAAK,GAAqC;QACxD;YACE,IAAI,EAAE,QAAQ;YACd,OAAO,EACL,iGAAiG;SACpG;KACF,CAAC;IAEF,MAAM,CAAC,KAAK,CACV,OAA2E,EAAE;QAE7E,MAAM,EAAE,QAAQ,GAAG,OAAO,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC;QACrD,OAAO,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,uBAAuB,CAAC,KAAK,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC;IAClF,CAAC;;AAhBH,0DAiBC"}
@@ -0,0 +1,22 @@
1
+ import type { TOxlintRuleEntry, TRuleSeverity } from './common';
2
+ /** One forbidden property access, with the message the author sees. */
3
+ export interface IRestrictedProperty {
4
+ property: string;
5
+ object?: string;
6
+ message: string;
7
+ }
8
+ /**
9
+ * `no-restricted-properties`. The default bans what exists only in a secure context (https,
10
+ * localhost): on a plain-http LAN origin or in a WebView, `crypto.randomUUID` is `undefined` and the
11
+ * first call throws. Catches the call, `globalThis.crypto.randomUUID`, the bracket form and
12
+ * destructuring; leaves `getRandomValues` alone.
13
+ */
14
+ export declare class NoRestrictedPropertiesRule {
15
+ static readonly NAME = "no-restricted-properties";
16
+ static readonly SECURE_CONTEXT: readonly IRestrictedProperty[];
17
+ static build(opts?: {
18
+ severity?: TRuleSeverity;
19
+ extraProperties?: IRestrictedProperty[];
20
+ }): TOxlintRuleEntry<'no-restricted-properties'>;
21
+ }
22
+ //# sourceMappingURL=no-restricted-properties.rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-restricted-properties.rule.d.ts","sourceRoot":"","sources":["../../../src/linters/rules/no-restricted-properties.rule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEhE,uEAAuE;AACvE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,qBAAa,0BAA0B;IACrC,MAAM,CAAC,QAAQ,CAAC,IAAI,8BAA8B;IAElD,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,SAAS,mBAAmB,EAAE,CAM5D;IAEF,MAAM,CAAC,KAAK,CACV,IAAI,GAAE;QAAE,QAAQ,CAAC,EAAE,aAAa,CAAC;QAAC,eAAe,CAAC,EAAE,mBAAmB,EAAE,CAAA;KAAO,GAC/E,gBAAgB,CAAC,0BAA0B,CAAC;CAIhD"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NoRestrictedPropertiesRule = void 0;
4
+ /**
5
+ * `no-restricted-properties`. The default bans what exists only in a secure context (https,
6
+ * localhost): on a plain-http LAN origin or in a WebView, `crypto.randomUUID` is `undefined` and the
7
+ * first call throws. Catches the call, `globalThis.crypto.randomUUID`, the bracket form and
8
+ * destructuring; leaves `getRandomValues` alone.
9
+ */
10
+ class NoRestrictedPropertiesRule {
11
+ static { this.NAME = 'no-restricted-properties'; }
12
+ static { this.SECURE_CONTEXT = [
13
+ {
14
+ property: 'randomUUID',
15
+ message: 'crypto.randomUUID exists only in a secure context (https, localhost) - on a plain-http origin it is undefined. Use uuidV4 from @venizia/ignis-helpers/uuid.',
16
+ },
17
+ ]; }
18
+ static build(opts = {}) {
19
+ const { severity = 'error', extraProperties = [] } = opts;
20
+ return [severity, ...NoRestrictedPropertiesRule.SECURE_CONTEXT, ...extraProperties];
21
+ }
22
+ }
23
+ exports.NoRestrictedPropertiesRule = NoRestrictedPropertiesRule;
24
+ //# sourceMappingURL=no-restricted-properties.rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-restricted-properties.rule.js","sourceRoot":"","sources":["../../../src/linters/rules/no-restricted-properties.rule.ts"],"names":[],"mappings":";;;AASA;;;;;GAKG;AACH,MAAa,0BAA0B;aACrB,SAAI,GAAG,0BAA0B,CAAC;aAElC,mBAAc,GAAmC;QAC/D;YACE,QAAQ,EAAE,YAAY;YACtB,OAAO,EACL,6JAA6J;SAChK;KACF,CAAC;IAEF,MAAM,CAAC,KAAK,CACV,OAA8E,EAAE;QAEhF,MAAM,EAAE,QAAQ,GAAG,OAAO,EAAE,eAAe,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC;QAC1D,OAAO,CAAC,QAAQ,EAAE,GAAG,0BAA0B,CAAC,cAAc,EAAE,GAAG,eAAe,CAAC,CAAC;IACtF,CAAC;;AAhBH,gEAiBC"}
@@ -0,0 +1,12 @@
1
+ import type { TOxlintRuleEntry, TRuleSeverity } from './common';
2
+ /** `no-unused-vars`. Unused arguments pass by default: an override keeps its signature. */
3
+ export declare class NoUnusedVarsRule {
4
+ static readonly NAME = "no-unused-vars";
5
+ static build(opts?: {
6
+ severity?: TRuleSeverity;
7
+ vars?: 'all' | 'local';
8
+ args?: 'all' | 'after-used' | 'none';
9
+ ignoreRestSiblings?: boolean;
10
+ }): TOxlintRuleEntry<'no-unused-vars'>;
11
+ }
12
+ //# sourceMappingURL=no-unused-vars.rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-unused-vars.rule.d.ts","sourceRoot":"","sources":["../../../src/linters/rules/no-unused-vars.rule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEhE,2FAA2F;AAC3F,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,QAAQ,CAAC,IAAI,oBAAoB;IAExC,MAAM,CAAC,KAAK,CACV,IAAI,GAAE;QACJ,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,KAAK,GAAG,YAAY,GAAG,MAAM,CAAC;QACrC,kBAAkB,CAAC,EAAE,OAAO,CAAC;KACzB,GACL,gBAAgB,CAAC,gBAAgB,CAAC;CAItC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NoUnusedVarsRule = void 0;
4
+ /** `no-unused-vars`. Unused arguments pass by default: an override keeps its signature. */
5
+ class NoUnusedVarsRule {
6
+ static { this.NAME = 'no-unused-vars'; }
7
+ static build(opts = {}) {
8
+ const { severity = 'error', vars = 'all', args = 'none', ignoreRestSiblings = false } = opts;
9
+ return [severity, { vars, args, ignoreRestSiblings }];
10
+ }
11
+ }
12
+ exports.NoUnusedVarsRule = NoUnusedVarsRule;
13
+ //# sourceMappingURL=no-unused-vars.rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-unused-vars.rule.js","sourceRoot":"","sources":["../../../src/linters/rules/no-unused-vars.rule.ts"],"names":[],"mappings":";;;AAEA,2FAA2F;AAC3F,MAAa,gBAAgB;aACX,SAAI,GAAG,gBAAgB,CAAC;IAExC,MAAM,CAAC,KAAK,CACV,OAKI,EAAE;QAEN,MAAM,EAAE,QAAQ,GAAG,OAAO,EAAE,IAAI,GAAG,KAAK,EAAE,IAAI,GAAG,MAAM,EAAE,kBAAkB,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC;QAC7F,OAAO,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;IACxD,CAAC;;AAbH,4CAcC"}
@@ -0,0 +1,12 @@
1
+ import type { TOxlintRuleEntry, TRuleSeverity } from './common';
2
+ /** `typescript/prefer-nullish-coalescing`, type-aware. Options are oxlint's, passed through. */
3
+ export declare class PreferNullishCoalescingRule {
4
+ static readonly NAME = "typescript/prefer-nullish-coalescing";
5
+ static build(opts?: {
6
+ severity?: TRuleSeverity;
7
+ ignoreConditionalTests?: boolean;
8
+ ignoreMixedLogicalExpressions?: boolean;
9
+ ignoreTernaryTests?: boolean;
10
+ }): TOxlintRuleEntry<'typescript/prefer-nullish-coalescing'>;
11
+ }
12
+ //# sourceMappingURL=prefer-nullish-coalescing.rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prefer-nullish-coalescing.rule.d.ts","sourceRoot":"","sources":["../../../src/linters/rules/prefer-nullish-coalescing.rule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEhE,gGAAgG;AAChG,qBAAa,2BAA2B;IACtC,MAAM,CAAC,QAAQ,CAAC,IAAI,0CAA0C;IAE9D,MAAM,CAAC,KAAK,CACV,IAAI,GAAE;QACJ,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,sBAAsB,CAAC,EAAE,OAAO,CAAC;QACjC,6BAA6B,CAAC,EAAE,OAAO,CAAC;QACxC,kBAAkB,CAAC,EAAE,OAAO,CAAC;KACzB,GACL,gBAAgB,CAAC,sCAAsC,CAAC;CAI5D"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PreferNullishCoalescingRule = void 0;
4
+ /** `typescript/prefer-nullish-coalescing`, type-aware. Options are oxlint's, passed through. */
5
+ class PreferNullishCoalescingRule {
6
+ static { this.NAME = 'typescript/prefer-nullish-coalescing'; }
7
+ static build(opts = {}) {
8
+ const { severity = 'error', ...options } = opts;
9
+ return Object.keys(options).length === 0 ? severity : [severity, options];
10
+ }
11
+ }
12
+ exports.PreferNullishCoalescingRule = PreferNullishCoalescingRule;
13
+ //# sourceMappingURL=prefer-nullish-coalescing.rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prefer-nullish-coalescing.rule.js","sourceRoot":"","sources":["../../../src/linters/rules/prefer-nullish-coalescing.rule.ts"],"names":[],"mappings":";;;AAEA,gGAAgG;AAChG,MAAa,2BAA2B;aACtB,SAAI,GAAG,sCAAsC,CAAC;IAE9D,MAAM,CAAC,KAAK,CACV,OAKI,EAAE;QAEN,MAAM,EAAE,QAAQ,GAAG,OAAO,EAAE,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC;QAChD,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;;AAbH,kEAcC"}
@@ -0,0 +1,10 @@
1
+ import type { TOxlintRuleEntry, TRuleSeverity } from './common';
2
+ /** `unicorn/switch-case-braces`. `always` gives every case its own block scope. */
3
+ export declare class SwitchCaseBracesRule {
4
+ static readonly NAME = "unicorn/switch-case-braces";
5
+ static build(opts?: {
6
+ severity?: TRuleSeverity;
7
+ mode?: 'always' | 'avoid';
8
+ }): TOxlintRuleEntry<'unicorn/switch-case-braces'>;
9
+ }
10
+ //# sourceMappingURL=switch-case-braces.rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch-case-braces.rule.d.ts","sourceRoot":"","sources":["../../../src/linters/rules/switch-case-braces.rule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEhE,mFAAmF;AACnF,qBAAa,oBAAoB;IAC/B,MAAM,CAAC,QAAQ,CAAC,IAAI,gCAAgC;IAEpD,MAAM,CAAC,KAAK,CACV,IAAI,GAAE;QAAE,QAAQ,CAAC,EAAE,aAAa,CAAC;QAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;KAAO,GACjE,gBAAgB,CAAC,4BAA4B,CAAC;CAIlD"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SwitchCaseBracesRule = void 0;
4
+ /** `unicorn/switch-case-braces`. `always` gives every case its own block scope. */
5
+ class SwitchCaseBracesRule {
6
+ static { this.NAME = 'unicorn/switch-case-braces'; }
7
+ static build(opts = {}) {
8
+ const { severity = 'error', mode = 'always' } = opts;
9
+ return [severity, mode];
10
+ }
11
+ }
12
+ exports.SwitchCaseBracesRule = SwitchCaseBracesRule;
13
+ //# sourceMappingURL=switch-case-braces.rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch-case-braces.rule.js","sourceRoot":"","sources":["../../../src/linters/rules/switch-case-braces.rule.ts"],"names":[],"mappings":";;;AAEA,mFAAmF;AACnF,MAAa,oBAAoB;aACf,SAAI,GAAG,4BAA4B,CAAC;IAEpD,MAAM,CAAC,KAAK,CACV,OAAgE,EAAE;QAElE,MAAM,EAAE,QAAQ,GAAG,OAAO,EAAE,IAAI,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC;QACrD,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC1B,CAAC;;AARH,oDASC"}