@zhangyu1818/oxlint-config 2.1.0 → 2.2.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/dist/index.d.ts +121 -116
- package/dist/index.js +825 -988
- package/dist/react-agent-rules.d.ts +45 -44
- package/dist/react-agent-rules.js +71 -101
- package/package.json +20 -19
package/dist/index.d.ts
CHANGED
|
@@ -1,177 +1,182 @@
|
|
|
1
|
+
//#region src/shared/ignore-patterns.d.ts
|
|
1
2
|
declare const defaultIgnorePatterns: string[];
|
|
2
|
-
|
|
3
|
+
//#endregion
|
|
4
|
+
//#region src/types.d.ts
|
|
3
5
|
type Severity = 'off' | 'warn' | 'error';
|
|
4
6
|
type JsonPrimitive = boolean | null | number | string;
|
|
5
7
|
type JsonValue = JsonObject | JsonPrimitive | JsonValue[];
|
|
6
8
|
interface JsonObject {
|
|
7
|
-
|
|
9
|
+
[key: string]: JsonValue;
|
|
8
10
|
}
|
|
9
11
|
type RuleConfig = Severity | [Severity, ...JsonValue[]];
|
|
10
12
|
type Rules = Record<string, RuleConfig>;
|
|
11
13
|
type OxlintGlobalValue = 'off' | 'readable' | 'readonly' | 'writable' | 'writeable' | boolean;
|
|
12
14
|
type OxlintGlobals = Record<string, OxlintGlobalValue>;
|
|
13
15
|
interface OxlintJsPluginAlias {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
name: string;
|
|
17
|
+
specifier: string;
|
|
16
18
|
}
|
|
17
19
|
type OxlintJsPlugin = OxlintJsPluginAlias | string;
|
|
18
20
|
type OxlintPlugin = 'eslint' | 'import' | 'jest' | 'jsdoc' | 'jsx-a11y' | 'nextjs' | 'node' | 'oxc' | 'promise' | 'react' | 'react-perf' | 'typescript' | 'unicorn' | 'vitest' | 'vue';
|
|
19
21
|
interface OxlintOverride {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
env?: Record<string, boolean>;
|
|
23
|
+
excludeFiles?: string[];
|
|
24
|
+
files: string[];
|
|
25
|
+
globals?: OxlintGlobals;
|
|
26
|
+
jsPlugins?: OxlintJsPlugin[];
|
|
27
|
+
plugins?: OxlintPlugin[];
|
|
28
|
+
rules?: Rules;
|
|
27
29
|
}
|
|
28
30
|
interface OxlintConfig {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
$schema?: string;
|
|
32
|
+
categories?: Record<string, Severity>;
|
|
33
|
+
env?: Record<string, boolean>;
|
|
34
|
+
extends?: string[];
|
|
35
|
+
globals?: OxlintGlobals;
|
|
36
|
+
ignorePatterns?: string[];
|
|
37
|
+
jsPlugins?: OxlintJsPlugin[];
|
|
38
|
+
options?: {
|
|
39
|
+
typeAware?: boolean;
|
|
40
|
+
typeCheck?: boolean;
|
|
41
|
+
};
|
|
42
|
+
overrides?: OxlintOverride[];
|
|
43
|
+
plugins?: OxlintPlugin[];
|
|
44
|
+
rules?: Rules;
|
|
45
|
+
settings?: Record<string, JsonValue>;
|
|
44
46
|
}
|
|
45
47
|
interface OxlintPresetConfig<TOptions = undefined> {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
enabled?: boolean;
|
|
49
|
+
options?: TOptions;
|
|
50
|
+
rules?: Rules;
|
|
49
51
|
}
|
|
50
52
|
interface IgnorePresetConfig {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
enabled?: boolean;
|
|
54
|
+
patterns?: string[];
|
|
53
55
|
}
|
|
54
56
|
interface ReactOptions {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
next?: boolean;
|
|
58
|
+
vite?: boolean;
|
|
57
59
|
}
|
|
58
60
|
interface ReactPresetOptions {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
a11y?: boolean;
|
|
62
|
+
framework?: ReactOptions;
|
|
61
63
|
}
|
|
62
64
|
interface TypeScriptOptions {
|
|
63
|
-
|
|
65
|
+
typeAware?: boolean;
|
|
64
66
|
}
|
|
65
67
|
interface OxlintPresets {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
ignores?: boolean | IgnorePresetConfig;
|
|
69
|
+
imports?: boolean | OxlintPresetConfig;
|
|
70
|
+
javascript?: boolean | OxlintPresetConfig;
|
|
71
|
+
next?: boolean | OxlintPresetConfig;
|
|
72
|
+
node?: boolean | OxlintPresetConfig;
|
|
73
|
+
react?: boolean | OxlintPresetConfig<ReactPresetOptions>;
|
|
74
|
+
reactAgentRules?: boolean | OxlintPresetConfig;
|
|
75
|
+
test?: boolean | OxlintPresetConfig;
|
|
76
|
+
typescript?: boolean | OxlintPresetConfig<TypeScriptOptions>;
|
|
77
|
+
unicorn?: boolean | OxlintPresetConfig;
|
|
76
78
|
}
|
|
77
79
|
interface DefineOxlintConfigOptions {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
80
|
+
categories?: Record<string, Severity>;
|
|
81
|
+
env?: Record<string, boolean>;
|
|
82
|
+
extends?: string[];
|
|
83
|
+
globals?: OxlintGlobals;
|
|
84
|
+
ignorePatterns?: string[];
|
|
85
|
+
jsPlugins?: OxlintJsPlugin[];
|
|
86
|
+
overrides?: OxlintOverride[];
|
|
87
|
+
presets?: OxlintPresets;
|
|
88
|
+
rules?: Rules;
|
|
89
|
+
settings?: Record<string, JsonValue>;
|
|
88
90
|
}
|
|
89
91
|
interface SortImportCustomGroup {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
elementNamePattern?: string[];
|
|
93
|
+
groupName: string;
|
|
94
|
+
modifiers?: string[];
|
|
95
|
+
selector?: string;
|
|
94
96
|
}
|
|
95
97
|
type SortImportGroup = {
|
|
96
|
-
|
|
98
|
+
newlinesBetween: boolean;
|
|
97
99
|
} | string | string[];
|
|
98
100
|
interface SortImportsOptions {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
101
|
+
customGroups?: SortImportCustomGroup[];
|
|
102
|
+
groups?: SortImportGroup[];
|
|
103
|
+
ignoreCase?: boolean;
|
|
104
|
+
internalPattern?: string[];
|
|
105
|
+
newlinesBetween?: boolean;
|
|
106
|
+
order?: 'asc' | 'desc';
|
|
107
|
+
partitionByComment?: boolean;
|
|
108
|
+
partitionByNewline?: boolean;
|
|
109
|
+
sortSideEffects?: boolean;
|
|
108
110
|
}
|
|
109
111
|
interface SortPackageJsonOptions {
|
|
110
|
-
|
|
112
|
+
sortScripts?: boolean;
|
|
111
113
|
}
|
|
112
114
|
interface TailwindSortOptions {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
attributes?: string[];
|
|
116
|
+
config?: string;
|
|
117
|
+
functions?: string[];
|
|
118
|
+
preserveDuplicates?: boolean;
|
|
119
|
+
preserveWhitespace?: boolean;
|
|
120
|
+
stylesheet?: string;
|
|
119
121
|
}
|
|
120
122
|
interface OxfmtOverrideOptions {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
123
|
+
endOfLine?: 'cr' | 'crlf' | 'lf';
|
|
124
|
+
printWidth?: number;
|
|
125
|
+
semi?: boolean;
|
|
126
|
+
singleQuote?: boolean;
|
|
127
|
+
sortImports?: boolean | SortImportsOptions;
|
|
128
|
+
sortPackageJson?: boolean | SortPackageJsonOptions;
|
|
129
|
+
sortTailwindcss?: boolean | TailwindSortOptions;
|
|
130
|
+
tabWidth?: number;
|
|
131
|
+
trailingComma?: 'all' | 'es5' | 'none';
|
|
132
|
+
useTabs?: boolean;
|
|
131
133
|
}
|
|
132
134
|
interface OxfmtOverride {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
excludeFiles?: string[];
|
|
136
|
+
files: string[];
|
|
137
|
+
options: OxfmtOverrideOptions;
|
|
136
138
|
}
|
|
137
139
|
interface OxfmtConfig extends OxfmtOverrideOptions {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
140
|
+
$schema?: string;
|
|
141
|
+
ignorePatterns?: string[];
|
|
142
|
+
overrides?: OxfmtOverride[];
|
|
141
143
|
}
|
|
142
144
|
interface OxfmtPresetConfig<TOptions = undefined> {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
+
enabled?: boolean;
|
|
146
|
+
options?: TOptions;
|
|
145
147
|
}
|
|
146
148
|
interface OxfmtPresets {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
149
|
+
imports?: boolean | OxfmtPresetConfig<SortImportsOptions>;
|
|
150
|
+
packageJson?: boolean | OxfmtPresetConfig<SortPackageJsonOptions>;
|
|
151
|
+
tailwindcss?: boolean | OxfmtPresetConfig<TailwindSortOptions>;
|
|
150
152
|
}
|
|
151
153
|
interface DefineOxfmtConfigOptions extends OxfmtOverrideOptions {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
154
|
+
ignorePatterns?: string[];
|
|
155
|
+
overrides?: OxfmtOverride[];
|
|
156
|
+
presets?: OxfmtPresets;
|
|
155
157
|
}
|
|
156
|
-
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region src/oxlint/index.d.ts
|
|
157
160
|
declare const defaultOxlintPresets: {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
161
|
+
ignores: true;
|
|
162
|
+
imports: true;
|
|
163
|
+
javascript: true;
|
|
164
|
+
next: boolean;
|
|
165
|
+
node: false;
|
|
166
|
+
react: boolean;
|
|
167
|
+
reactAgentRules: boolean;
|
|
168
|
+
test: boolean;
|
|
169
|
+
typescript: boolean;
|
|
170
|
+
unicorn: true;
|
|
168
171
|
};
|
|
169
172
|
declare function defineOxlintConfig(options?: DefineOxlintConfigOptions): OxlintConfig;
|
|
170
173
|
declare const defineConfig: typeof defineOxlintConfig;
|
|
171
|
-
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region src/oxfmt/presets/imports.d.ts
|
|
172
176
|
declare const defaultSortImports: SortImportsOptions;
|
|
173
|
-
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/oxfmt/index.d.ts
|
|
174
179
|
declare const defaultOxfmtPresets: Required<OxfmtPresets>;
|
|
175
180
|
declare function defineOxfmtConfig(options?: DefineOxfmtConfigOptions): OxfmtConfig;
|
|
176
|
-
|
|
177
|
-
export { type DefineOxfmtConfigOptions, type DefineOxlintConfigOptions, type OxfmtConfig, type OxfmtOverride, type OxfmtPresetConfig, type OxfmtPresets, type OxlintConfig, type OxlintGlobalValue, type OxlintGlobals, type OxlintJsPlugin, type OxlintJsPluginAlias, type OxlintOverride, type OxlintPlugin, type OxlintPresetConfig, type OxlintPresets, type ReactOptions, type ReactPresetOptions, type RuleConfig, type Rules, type Severity, type SortImportsOptions, type SortPackageJsonOptions, type TailwindSortOptions, type TypeScriptOptions, defaultIgnorePatterns, defaultOxfmtPresets, defaultOxlintPresets, defaultSortImports, defineConfig, defineOxfmtConfig, defineOxlintConfig };
|
|
181
|
+
//#endregion
|
|
182
|
+
export { type DefineOxfmtConfigOptions, type DefineOxlintConfigOptions, type OxfmtConfig, type OxfmtOverride, type OxfmtPresetConfig, type OxfmtPresets, type OxlintConfig, type OxlintGlobalValue, type OxlintGlobals, type OxlintJsPlugin, type OxlintJsPluginAlias, type OxlintOverride, type OxlintPlugin, type OxlintPresetConfig, type OxlintPresets, type ReactOptions, type ReactPresetOptions, type RuleConfig, type Rules, type Severity, type SortImportsOptions, type SortPackageJsonOptions, type TailwindSortOptions, type TypeScriptOptions, defaultIgnorePatterns, defaultOxfmtPresets, defaultOxlintPresets, defaultSortImports, defineConfig, defineOxfmtConfig, defineOxlintConfig };
|