@cerios/sparta-lint-rules 0.0.1 → 0.0.3
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/LICENSE +7 -7
- package/README.md +87 -40
- package/dist/conventions-DK3A7JWL.d.cts +97 -0
- package/dist/conventions-DK3A7JWL.d.mts +97 -0
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -1
- package/dist/index.d.mts +16 -2
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/dist/oxlint.cjs +2 -1
- package/dist/oxlint.cjs.map +1 -1
- package/dist/oxlint.d.cts +18 -1
- package/dist/oxlint.d.mts +19 -2
- package/dist/oxlint.mjs +2 -1
- package/dist/oxlint.mjs.map +1 -1
- package/dist/{plugin-types-CgeW0cQl.d.cts → plugin-types-7QJakt0Z.d.cts} +10 -4
- package/dist/{plugin-types-CgeW0cQl.d.mts → plugin-types-7QJakt0Z.d.mts} +10 -4
- package/dist/{rules-COk7kmEU.cjs → rules-5VZcw4ds.cjs} +868 -175
- package/dist/rules-5VZcw4ds.cjs.map +1 -0
- package/dist/{rules-BSRYNh4F.mjs → rules-Ay2ZlXtg.mjs} +868 -175
- package/dist/rules-Ay2ZlXtg.mjs.map +1 -0
- package/dist/settings.cjs +1 -0
- package/dist/settings.d.cts +5 -92
- package/dist/settings.d.mts +5 -92
- package/dist/settings.mjs +1 -0
- package/oxlintrc.schema.json +718 -0
- package/package.json +10 -3
- package/dist/rules-BSRYNh4F.mjs.map +0 -1
- package/dist/rules-COk7kmEU.cjs.map +0 -1
package/dist/oxlint.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oxlint.mjs","names":[],"sources":["../src/oxlint.ts"],"sourcesContent":["import type { SpartaOxlintConfig } from \"./plugin-types\";\nimport { recommendedRules } from \"./rules\";\n\n/**\n * Recommended oxlint config, to extend from `oxlint.config.ts`:\n *\n * ```ts\n * import { defineConfig } from \"oxlint\";\n * import sparta from \"@cerios/sparta-lint-rules/oxlint\";\n *\n * export default defineConfig({ extends: [sparta] });\n * ```\n */\nconst config: SpartaOxlintConfig = {\n\tjsPlugins: [\"@cerios/sparta-lint-rules\"],\n\trules: recommendedRules,\n};\n\nexport default config;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"oxlint.mjs","names":[],"sources":["../src/oxlint.ts"],"sourcesContent":["import type { AllowWarnDeny, Oxlintrc } from \"oxlint\";\n\nimport type { SpartaOxlintConfig } from \"./plugin-types\";\nimport { type PLUGIN_NAME, type RuleName, recommendedRules } from \"./rules\";\nimport type { SpartaSettings } from \"./utils/conventions\";\n\n/** The sparta rules take no options, so a severity or a one-element tuple. */\ntype SpartaOxlintRules = { [Name in RuleName as `${typeof PLUGIN_NAME}/${Name}`]?: AllowWarnDeny | [AllowWarnDeny] };\n\n/**\n * Adds the sparta rule names and `settings.sparta` to oxlint's own config types, so `defineConfig()` autocompletes\n * them in `oxlint.config.ts` as soon as this entry is imported.\n */\ndeclare module \"oxlint\" {\n\tinterface DummyRuleMap extends SpartaOxlintRules {}\n\n\tinterface OxlintConfig {\n\t\tsettings?: NonNullable<Oxlintrc[\"settings\"]> & { sparta?: SpartaSettings };\n\t}\n}\n\n/**\n * Recommended oxlint config, to extend from `oxlint.config.ts`:\n *\n * ```ts\n * import { defineConfig } from \"oxlint\";\n * import sparta from \"@cerios/sparta-lint-rules/oxlint\";\n *\n * export default defineConfig({ extends: [sparta] });\n * ```\n */\nconst config: SpartaOxlintConfig = {\n\tjsPlugins: [\"@cerios/sparta-lint-rules\"],\n\trules: recommendedRules,\n};\n\nexport default config;\n"],"mappings":";;;;;;;;;;;;;AA+BA,MAAM,SAA6B;CAClC,WAAW,CAAC,2BAA2B;CACvC,OAAO;AACR"}
|
|
@@ -1,20 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
import { RuleDefinition } from "@eslint/core";
|
|
1
3
|
declare const rules: {
|
|
2
4
|
"architecture-boundaries": import("@oxlint/plugins").CreateRule;
|
|
3
5
|
"class-matches-filename": import("@oxlint/plugins").CreateRule;
|
|
6
|
+
"director-composes-builders": import("@oxlint/plugins").CreateRule;
|
|
4
7
|
"expect-from-support": import("@oxlint/plugins").CreateRule;
|
|
5
8
|
"file-naming": import("@oxlint/plugins").CreateRule;
|
|
6
9
|
"lines-between-class-members": import("@oxlint/plugins").CreateRule;
|
|
10
|
+
"member-ordering": import("@oxlint/plugins").CreateRule;
|
|
7
11
|
"no-direct-construction-in-tests": import("@oxlint/plugins").CreateRule;
|
|
8
12
|
"no-expect-in-tests": import("@oxlint/plugins").CreateRule;
|
|
9
13
|
"no-hard-waits": import("@oxlint/plugins").CreateRule;
|
|
10
14
|
"no-nested-polling": import("@oxlint/plugins").CreateRule;
|
|
11
15
|
"padding-lines": import("@oxlint/plugins").CreateRule;
|
|
12
|
-
"private-members-last": import("@oxlint/plugins").CreateRule;
|
|
13
16
|
"step-placeholders": import("@oxlint/plugins").CreateRule;
|
|
14
17
|
"step-required": import("@oxlint/plugins").CreateRule;
|
|
15
18
|
};
|
|
19
|
+
type RuleName = keyof typeof rules;
|
|
20
|
+
declare const PLUGIN_NAME = "sparta";
|
|
16
21
|
type Severity = "error" | "warn";
|
|
17
|
-
/** ESLint flat config entry. Typed structurally so
|
|
22
|
+
/** ESLint flat config entry. Typed structurally so it fits ESLint's `defineConfig()`. */
|
|
18
23
|
interface SpartaFlatConfig {
|
|
19
24
|
name: string;
|
|
20
25
|
plugins: Record<string, SpartaPlugin>;
|
|
@@ -25,7 +30,8 @@ interface SpartaPlugin {
|
|
|
25
30
|
name: string;
|
|
26
31
|
version: string;
|
|
27
32
|
};
|
|
28
|
-
rules
|
|
33
|
+
/** Typed as ESLint rules for ESLint configs; oxlint loads the plugin by name and doesn't read these types. */
|
|
34
|
+
rules: Record<RuleName, RuleDefinition>;
|
|
29
35
|
configs: {
|
|
30
36
|
recommended: SpartaFlatConfig;
|
|
31
37
|
};
|
|
@@ -34,4 +40,4 @@ interface SpartaOxlintConfig {
|
|
|
34
40
|
jsPlugins: string[];
|
|
35
41
|
rules: Record<string, Severity>;
|
|
36
42
|
}
|
|
37
|
-
export { SpartaPlugin as n, SpartaOxlintConfig as t };
|
|
43
|
+
export { RuleName as i, SpartaPlugin as n, PLUGIN_NAME as r, SpartaOxlintConfig as t };
|
|
@@ -1,20 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
import { RuleDefinition } from "@eslint/core";
|
|
1
3
|
declare const rules: {
|
|
2
4
|
"architecture-boundaries": import("@oxlint/plugins").CreateRule;
|
|
3
5
|
"class-matches-filename": import("@oxlint/plugins").CreateRule;
|
|
6
|
+
"director-composes-builders": import("@oxlint/plugins").CreateRule;
|
|
4
7
|
"expect-from-support": import("@oxlint/plugins").CreateRule;
|
|
5
8
|
"file-naming": import("@oxlint/plugins").CreateRule;
|
|
6
9
|
"lines-between-class-members": import("@oxlint/plugins").CreateRule;
|
|
10
|
+
"member-ordering": import("@oxlint/plugins").CreateRule;
|
|
7
11
|
"no-direct-construction-in-tests": import("@oxlint/plugins").CreateRule;
|
|
8
12
|
"no-expect-in-tests": import("@oxlint/plugins").CreateRule;
|
|
9
13
|
"no-hard-waits": import("@oxlint/plugins").CreateRule;
|
|
10
14
|
"no-nested-polling": import("@oxlint/plugins").CreateRule;
|
|
11
15
|
"padding-lines": import("@oxlint/plugins").CreateRule;
|
|
12
|
-
"private-members-last": import("@oxlint/plugins").CreateRule;
|
|
13
16
|
"step-placeholders": import("@oxlint/plugins").CreateRule;
|
|
14
17
|
"step-required": import("@oxlint/plugins").CreateRule;
|
|
15
18
|
};
|
|
19
|
+
type RuleName = keyof typeof rules;
|
|
20
|
+
declare const PLUGIN_NAME = "sparta";
|
|
16
21
|
type Severity = "error" | "warn";
|
|
17
|
-
/** ESLint flat config entry. Typed structurally so
|
|
22
|
+
/** ESLint flat config entry. Typed structurally so it fits ESLint's `defineConfig()`. */
|
|
18
23
|
interface SpartaFlatConfig {
|
|
19
24
|
name: string;
|
|
20
25
|
plugins: Record<string, SpartaPlugin>;
|
|
@@ -25,7 +30,8 @@ interface SpartaPlugin {
|
|
|
25
30
|
name: string;
|
|
26
31
|
version: string;
|
|
27
32
|
};
|
|
28
|
-
rules
|
|
33
|
+
/** Typed as ESLint rules for ESLint configs; oxlint loads the plugin by name and doesn't read these types. */
|
|
34
|
+
rules: Record<RuleName, RuleDefinition>;
|
|
29
35
|
configs: {
|
|
30
36
|
recommended: SpartaFlatConfig;
|
|
31
37
|
};
|
|
@@ -34,4 +40,4 @@ interface SpartaOxlintConfig {
|
|
|
34
40
|
jsPlugins: string[];
|
|
35
41
|
rules: Record<string, Severity>;
|
|
36
42
|
}
|
|
37
|
-
export { SpartaPlugin as n, SpartaOxlintConfig as t };
|
|
43
|
+
export { RuleName as i, SpartaPlugin as n, PLUGIN_NAME as r, SpartaOxlintConfig as t };
|