@apst/oxlint 0.0.0-dev.20260324.019d1d21
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 +21 -0
- package/dist/@types/preset.d.ts +25 -0
- package/dist/constants/default.d.ts +8 -0
- package/dist/constants/default.js +10 -0
- package/dist/constants/default.js.map +1 -0
- package/dist/constants/default.mjs +9 -0
- package/dist/constants/default.mjs.map +1 -0
- package/dist/constants/ignore-patterns.d.ts +3 -0
- package/dist/constants/ignore-patterns.js +26 -0
- package/dist/constants/ignore-patterns.js.map +1 -0
- package/dist/constants/ignore-patterns.mjs +24 -0
- package/dist/constants/ignore-patterns.mjs.map +1 -0
- package/dist/functions/define.d.ts +46 -0
- package/dist/functions/define.js +19 -0
- package/dist/functions/define.js.map +1 -0
- package/dist/functions/define.mjs +19 -0
- package/dist/functions/define.mjs.map +1 -0
- package/dist/functions/merge.js +11 -0
- package/dist/functions/merge.js.map +1 -0
- package/dist/functions/merge.mjs +11 -0
- package/dist/functions/merge.mjs.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/dist/index.mjs +3 -0
- package/dist/presets/common/index.d.ts +9 -0
- package/dist/presets/common/index.js +45 -0
- package/dist/presets/common/index.mjs +10 -0
- package/dist/presets/common/plugin/index.d.ts +3 -0
- package/dist/presets/common/plugin/index.js +12 -0
- package/dist/presets/common/plugin/index.js.map +1 -0
- package/dist/presets/common/plugin/index.mjs +11 -0
- package/dist/presets/common/plugin/index.mjs.map +1 -0
- package/dist/presets/common/preset/index.d.ts +4 -0
- package/dist/presets/common/preset/index.js +27 -0
- package/dist/presets/common/preset/index.js.map +1 -0
- package/dist/presets/common/preset/index.mjs +27 -0
- package/dist/presets/common/preset/index.mjs.map +1 -0
- package/dist/presets/common/rules/eslint.d.ts +174 -0
- package/dist/presets/common/rules/eslint.js +93 -0
- package/dist/presets/common/rules/eslint.js.map +1 -0
- package/dist/presets/common/rules/eslint.mjs +86 -0
- package/dist/presets/common/rules/eslint.mjs.map +1 -0
- package/dist/presets/common/rules/import.d.ts +64 -0
- package/dist/presets/common/rules/import.js +55 -0
- package/dist/presets/common/rules/import.js.map +1 -0
- package/dist/presets/common/rules/import.mjs +49 -0
- package/dist/presets/common/rules/import.mjs.map +1 -0
- package/dist/presets/common/rules/oxc.d.ts +15 -0
- package/dist/presets/common/rules/oxc.js +18 -0
- package/dist/presets/common/rules/oxc.js.map +1 -0
- package/dist/presets/common/rules/oxc.mjs +15 -0
- package/dist/presets/common/rules/oxc.mjs.map +1 -0
- package/dist/presets/common/rules/promise.d.ts +34 -0
- package/dist/presets/common/rules/promise.js +30 -0
- package/dist/presets/common/rules/promise.js.map +1 -0
- package/dist/presets/common/rules/promise.mjs +24 -0
- package/dist/presets/common/rules/promise.mjs.map +1 -0
- package/dist/presets/common/rules/typescript.d.ts +288 -0
- package/dist/presets/common/rules/typescript.js +149 -0
- package/dist/presets/common/rules/typescript.js.map +1 -0
- package/dist/presets/common/rules/typescript.mjs +143 -0
- package/dist/presets/common/rules/typescript.mjs.map +1 -0
- package/dist/presets/common/rules/unicorn.d.ts +168 -0
- package/dist/presets/common/rules/unicorn.js +90 -0
- package/dist/presets/common/rules/unicorn.js.map +1 -0
- package/dist/presets/common/rules/unicorn.mjs +85 -0
- package/dist/presets/common/rules/unicorn.mjs.map +1 -0
- package/dist/presets/jsx/index.d.ts +4 -0
- package/dist/presets/jsx/index.js +9 -0
- package/dist/presets/jsx/index.mjs +5 -0
- package/dist/presets/jsx/plugin/index.d.ts +3 -0
- package/dist/presets/jsx/plugin/index.js +5 -0
- package/dist/presets/jsx/plugin/index.js.map +1 -0
- package/dist/presets/jsx/plugin/index.mjs +4 -0
- package/dist/presets/jsx/plugin/index.mjs.map +1 -0
- package/dist/presets/jsx/preset/index.d.ts +4 -0
- package/dist/presets/jsx/preset/index.js +15 -0
- package/dist/presets/jsx/preset/index.js.map +1 -0
- package/dist/presets/jsx/preset/index.mjs +15 -0
- package/dist/presets/jsx/preset/index.mjs.map +1 -0
- package/dist/presets/jsx/rules/jsx-a11y.d.ts +36 -0
- package/dist/presets/jsx/rules/jsx-a11y.js +23 -0
- package/dist/presets/jsx/rules/jsx-a11y.js.map +1 -0
- package/dist/presets/jsx/rules/jsx-a11y.mjs +21 -0
- package/dist/presets/jsx/rules/jsx-a11y.mjs.map +1 -0
- package/dist/presets/next/index.d.ts +3 -0
- package/dist/presets/next/index.js +6 -0
- package/dist/presets/next/index.mjs +4 -0
- package/dist/presets/next/plugin/index.d.ts +3 -0
- package/dist/presets/next/plugin/index.js +5 -0
- package/dist/presets/next/plugin/index.js.map +1 -0
- package/dist/presets/next/plugin/index.mjs +4 -0
- package/dist/presets/next/plugin/index.mjs.map +1 -0
- package/dist/presets/next/preset/index.d.ts +4 -0
- package/dist/presets/next/preset/index.js +15 -0
- package/dist/presets/next/preset/index.js.map +1 -0
- package/dist/presets/next/preset/index.mjs +15 -0
- package/dist/presets/next/preset/index.mjs.map +1 -0
- package/dist/presets/next/rules/nextjs.js +26 -0
- package/dist/presets/next/rules/nextjs.js.map +1 -0
- package/dist/presets/next/rules/nextjs.mjs +25 -0
- package/dist/presets/next/rules/nextjs.mjs.map +1 -0
- package/dist/presets/node/index.d.ts +4 -0
- package/dist/presets/node/index.js +10 -0
- package/dist/presets/node/index.mjs +5 -0
- package/dist/presets/node/plugin/index.d.ts +3 -0
- package/dist/presets/node/plugin/index.js +5 -0
- package/dist/presets/node/plugin/index.js.map +1 -0
- package/dist/presets/node/plugin/index.mjs +4 -0
- package/dist/presets/node/plugin/index.mjs.map +1 -0
- package/dist/presets/node/preset/index.d.ts +4 -0
- package/dist/presets/node/preset/index.js +15 -0
- package/dist/presets/node/preset/index.js.map +1 -0
- package/dist/presets/node/preset/index.mjs +15 -0
- package/dist/presets/node/preset/index.mjs.map +1 -0
- package/dist/presets/node/rules/node.d.ts +16 -0
- package/dist/presets/node/rules/node.js +16 -0
- package/dist/presets/node/rules/node.js.map +1 -0
- package/dist/presets/node/rules/node.mjs +13 -0
- package/dist/presets/node/rules/node.mjs.map +1 -0
- package/dist/presets/react/index.d.ts +4 -0
- package/dist/presets/react/index.js +14 -0
- package/dist/presets/react/index.mjs +5 -0
- package/dist/presets/react/plugin/index.d.ts +3 -0
- package/dist/presets/react/plugin/index.js +5 -0
- package/dist/presets/react/plugin/index.js.map +1 -0
- package/dist/presets/react/plugin/index.mjs +4 -0
- package/dist/presets/react/plugin/index.mjs.map +1 -0
- package/dist/presets/react/preset/index.d.ts +4 -0
- package/dist/presets/react/preset/index.js +15 -0
- package/dist/presets/react/preset/index.js.map +1 -0
- package/dist/presets/react/preset/index.mjs +15 -0
- package/dist/presets/react/preset/index.mjs.map +1 -0
- package/dist/presets/react/rules/react.d.ts +130 -0
- package/dist/presets/react/rules/react.js +83 -0
- package/dist/presets/react/rules/react.js.map +1 -0
- package/dist/presets/react/rules/react.mjs +76 -0
- package/dist/presets/react/rules/react.mjs.map +1 -0
- package/dist/presets/vitest/index.d.ts +4 -0
- package/dist/presets/vitest/index.js +10 -0
- package/dist/presets/vitest/index.mjs +5 -0
- package/dist/presets/vitest/plugin/index.d.ts +3 -0
- package/dist/presets/vitest/plugin/index.js +5 -0
- package/dist/presets/vitest/plugin/index.js.map +1 -0
- package/dist/presets/vitest/plugin/index.mjs +4 -0
- package/dist/presets/vitest/plugin/index.mjs.map +1 -0
- package/dist/presets/vitest/preset/index.d.ts +4 -0
- package/dist/presets/vitest/preset/index.js +15 -0
- package/dist/presets/vitest/preset/index.js.map +1 -0
- package/dist/presets/vitest/preset/index.mjs +15 -0
- package/dist/presets/vitest/preset/index.mjs.map +1 -0
- package/dist/presets/vitest/rules/vitest.d.ts +42 -0
- package/dist/presets/vitest/rules/vitest.js +27 -0
- package/dist/presets/vitest/rules/vitest.js.map +1 -0
- package/dist/presets/vitest/rules/vitest.mjs +24 -0
- package/dist/presets/vitest/rules/vitest.mjs.map +1 -0
- package/package.json +97 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026-present, Alpheus
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { OxlintConfig } from "oxlint";
|
|
2
|
+
/**
|
|
3
|
+
* Preset context.
|
|
4
|
+
*/
|
|
5
|
+
type PresetContext = {
|
|
6
|
+
/**
|
|
7
|
+
* Oxlint configuration.
|
|
8
|
+
*/
|
|
9
|
+
config: OxlintConfig;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Preset result.
|
|
13
|
+
*/
|
|
14
|
+
type PresetResult = {
|
|
15
|
+
/**
|
|
16
|
+
* Oxlint configuration.
|
|
17
|
+
*/
|
|
18
|
+
config: OxlintConfig;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Preset for the Oxlint configuration.
|
|
22
|
+
*/
|
|
23
|
+
type Preset = (context: PresetContext) => PresetResult;
|
|
24
|
+
export { type Preset };
|
|
25
|
+
//# sourceMappingURL=preset.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default config for Oxlint.
|
|
3
|
+
*/
|
|
4
|
+
declare const CONFIG_DEFAULT: {
|
|
5
|
+
readonly ignorePatterns: ["**/.git/**", "**/__MACOSX/**", "**/.DS_Store", "**/node_modules/**", "**/.panda/**", "**/.next/**", "**/.expo/**", "**/.vercel/**", "**/dist/**", "build/**", "app/build/**", "web/build/**", "out/**", "app/out/**", "web/out/**", "**/package-lock.json", "**/yarn.lock", "**/pnpm-lock.yaml", "**/bun.lock"];
|
|
6
|
+
};
|
|
7
|
+
export { CONFIG_DEFAULT };
|
|
8
|
+
//# sourceMappingURL=default.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_constants_ignore_patterns = require('./ignore-patterns.js');
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Default config for Oxlint.
|
|
6
|
+
*/
|
|
7
|
+
const CONFIG_DEFAULT = { ignorePatterns: require_constants_ignore_patterns.IGNORE_PATTERNS_DEFAULT };
|
|
8
|
+
|
|
9
|
+
exports.CONFIG_DEFAULT = CONFIG_DEFAULT;
|
|
10
|
+
//# sourceMappingURL=default.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default.js","names":["IGNORE_PATTERNS_DEFAULT"],"sources":["../../src/constants/default.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\";\n\nimport { IGNORE_PATTERNS_DEFAULT } from \"#/constants/ignore-patterns\";\n\n/**\n * Default config for Oxlint.\n */\nconst CONFIG_DEFAULT = {\n ignorePatterns: IGNORE_PATTERNS_DEFAULT,\n} as const satisfies OxlintConfig;\n\nexport { CONFIG_DEFAULT };\n"],"mappings":";;;;;;AAOA,MAAM,iBAAiB,EACnB,gBAAgBA,2DACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default.mjs","names":[],"sources":["../../src/constants/default.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\";\n\nimport { IGNORE_PATTERNS_DEFAULT } from \"#/constants/ignore-patterns\";\n\n/**\n * Default config for Oxlint.\n */\nconst CONFIG_DEFAULT = {\n ignorePatterns: IGNORE_PATTERNS_DEFAULT,\n} as const satisfies OxlintConfig;\n\nexport { CONFIG_DEFAULT };\n"],"mappings":";;;;;AAOA,MAAM,iBAAiB,EACnB,gBAAgB,yBACnB"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const IGNORE_PATTERNS_DEFAULT: ["**/.git/**", "**/__MACOSX/**", "**/.DS_Store", "**/node_modules/**", "**/.panda/**", "**/.next/**", "**/.expo/**", "**/.vercel/**", "**/dist/**", "build/**", "app/build/**", "web/build/**", "out/**", "app/out/**", "web/out/**", "**/package-lock.json", "**/yarn.lock", "**/pnpm-lock.yaml", "**/bun.lock"];
|
|
2
|
+
export { IGNORE_PATTERNS_DEFAULT };
|
|
3
|
+
//# sourceMappingURL=ignore-patterns.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const IGNORE_PATTERNS_DEFAULT = [
|
|
4
|
+
"**/.git/**",
|
|
5
|
+
"**/__MACOSX/**",
|
|
6
|
+
"**/.DS_Store",
|
|
7
|
+
"**/node_modules/**",
|
|
8
|
+
"**/.panda/**",
|
|
9
|
+
"**/.next/**",
|
|
10
|
+
"**/.expo/**",
|
|
11
|
+
"**/.vercel/**",
|
|
12
|
+
"**/dist/**",
|
|
13
|
+
"build/**",
|
|
14
|
+
"app/build/**",
|
|
15
|
+
"web/build/**",
|
|
16
|
+
"out/**",
|
|
17
|
+
"app/out/**",
|
|
18
|
+
"web/out/**",
|
|
19
|
+
"**/package-lock.json",
|
|
20
|
+
"**/yarn.lock",
|
|
21
|
+
"**/pnpm-lock.yaml",
|
|
22
|
+
"**/bun.lock"
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
exports.IGNORE_PATTERNS_DEFAULT = IGNORE_PATTERNS_DEFAULT;
|
|
26
|
+
//# sourceMappingURL=ignore-patterns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ignore-patterns.js","names":[],"sources":["../../src/constants/ignore-patterns.ts"],"sourcesContent":["const IGNORE_PATTERNS_DEFAULT = [\n // git\n \"**/.git/**\",\n // macOS\n \"**/__MACOSX/**\",\n \"**/.DS_Store\",\n // node modules\n \"**/node_modules/**\",\n // build\n \"**/.panda/**\",\n \"**/.next/**\",\n \"**/.expo/**\",\n \"**/.vercel/**\",\n \"**/dist/**\",\n \"build/**\",\n \"app/build/**\",\n \"web/build/**\",\n \"out/**\",\n \"app/out/**\",\n \"web/out/**\",\n // lock\n \"**/package-lock.json\",\n \"**/yarn.lock\",\n \"**/pnpm-lock.yaml\",\n \"**/bun.lock\",\n] as const satisfies string[];\n\nexport { IGNORE_PATTERNS_DEFAULT };\n"],"mappings":";;AAAA,MAAM,0BAA0B;CAE5B;CAEA;CACA;CAEA;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACH"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const IGNORE_PATTERNS_DEFAULT = [
|
|
2
|
+
"**/.git/**",
|
|
3
|
+
"**/__MACOSX/**",
|
|
4
|
+
"**/.DS_Store",
|
|
5
|
+
"**/node_modules/**",
|
|
6
|
+
"**/.panda/**",
|
|
7
|
+
"**/.next/**",
|
|
8
|
+
"**/.expo/**",
|
|
9
|
+
"**/.vercel/**",
|
|
10
|
+
"**/dist/**",
|
|
11
|
+
"build/**",
|
|
12
|
+
"app/build/**",
|
|
13
|
+
"web/build/**",
|
|
14
|
+
"out/**",
|
|
15
|
+
"app/out/**",
|
|
16
|
+
"web/out/**",
|
|
17
|
+
"**/package-lock.json",
|
|
18
|
+
"**/yarn.lock",
|
|
19
|
+
"**/pnpm-lock.yaml",
|
|
20
|
+
"**/bun.lock"
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
export { IGNORE_PATTERNS_DEFAULT };
|
|
24
|
+
//# sourceMappingURL=ignore-patterns.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ignore-patterns.mjs","names":[],"sources":["../../src/constants/ignore-patterns.ts"],"sourcesContent":["const IGNORE_PATTERNS_DEFAULT = [\n // git\n \"**/.git/**\",\n // macOS\n \"**/__MACOSX/**\",\n \"**/.DS_Store\",\n // node modules\n \"**/node_modules/**\",\n // build\n \"**/.panda/**\",\n \"**/.next/**\",\n \"**/.expo/**\",\n \"**/.vercel/**\",\n \"**/dist/**\",\n \"build/**\",\n \"app/build/**\",\n \"web/build/**\",\n \"out/**\",\n \"app/out/**\",\n \"web/out/**\",\n // lock\n \"**/package-lock.json\",\n \"**/yarn.lock\",\n \"**/pnpm-lock.yaml\",\n \"**/bun.lock\",\n] as const satisfies string[];\n\nexport { IGNORE_PATTERNS_DEFAULT };\n"],"mappings":"AAAA,MAAM,0BAA0B;CAE5B;CAEA;CACA;CAEA;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACH"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Preset } from "../@types/preset.js";
|
|
2
|
+
import { OxlintConfig } from "oxlint";
|
|
3
|
+
/**
|
|
4
|
+
* Define Oxlint configuration.
|
|
5
|
+
*
|
|
6
|
+
* ### Example
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { defineConfig } from "@apst/oxlint";
|
|
10
|
+
* import { commonPreset } from "@apst/oxlint/presets/common";
|
|
11
|
+
* import { reactPreset } from "@apst/oxlint/presets/react";
|
|
12
|
+
*
|
|
13
|
+
* export default defineConfig([
|
|
14
|
+
* commonPreset(),
|
|
15
|
+
* reactPreset(),
|
|
16
|
+
* ]);
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare function defineConfig(presets?: Preset[]): OxlintConfig;
|
|
20
|
+
/**
|
|
21
|
+
* Define Oxlint configuration.
|
|
22
|
+
*
|
|
23
|
+
* All arrays will not be merged, adding new values will replace existing values.
|
|
24
|
+
*
|
|
25
|
+
* ### Example
|
|
26
|
+
*
|
|
27
|
+
* ```ts
|
|
28
|
+
* import { defineConfig } from "@apst/oxlint";
|
|
29
|
+
* import { IGNORE_PATTERNS_DEFAULT } from "@apst/oxlint/constants/ignore-patterns";
|
|
30
|
+
* import { commonPreset } from "@apst/oxlint/presets/common";
|
|
31
|
+
* import { reactPreset } from "@apst/oxlint/presets/react";
|
|
32
|
+
*
|
|
33
|
+
* export default defineConfig({
|
|
34
|
+
* ignorePatterns: [
|
|
35
|
+
* ...IGNORE_PATTERNS_DEFAULT,
|
|
36
|
+
* // ...
|
|
37
|
+
* ],
|
|
38
|
+
* }, [
|
|
39
|
+
* commonPreset(),
|
|
40
|
+
* reactPreset(),
|
|
41
|
+
* ]);
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
declare function defineConfig(config?: OxlintConfig, presets?: Preset[]): OxlintConfig;
|
|
45
|
+
export { defineConfig };
|
|
46
|
+
//# sourceMappingURL=define.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const require_constants_default = require('../constants/default.js');
|
|
2
|
+
const require_merge = require('./merge.js');
|
|
3
|
+
let es_toolkit = require("es-toolkit");
|
|
4
|
+
|
|
5
|
+
const defineConfigFn = (userConfig, presets) => {
|
|
6
|
+
let config = require_merge.mergeConfig((0, es_toolkit.clone)(require_constants_default.CONFIG_DEFAULT), userConfig);
|
|
7
|
+
if (!presets) return config;
|
|
8
|
+
for (const preset of presets) {
|
|
9
|
+
const presetResult = preset({ config });
|
|
10
|
+
config = (0, es_toolkit.toMerged)(config, presetResult.config);
|
|
11
|
+
}
|
|
12
|
+
return config;
|
|
13
|
+
};
|
|
14
|
+
function defineConfig(presetsOrConfig, optionalPresets) {
|
|
15
|
+
return defineConfigFn(Array.isArray(presetsOrConfig) ? void 0 : presetsOrConfig, Array.isArray(presetsOrConfig) ? presetsOrConfig : optionalPresets);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
exports.defineConfig = defineConfig;
|
|
19
|
+
//# sourceMappingURL=define.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define.js","names":["mergeConfig","CONFIG_DEFAULT"],"sources":["../../src/functions/define.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\";\n\nimport type { Preset, PresetResult } from \"#/@types/preset\";\n\nimport { clone, toMerged } from \"es-toolkit\";\n\nimport { CONFIG_DEFAULT } from \"#/constants/default\";\nimport { mergeConfig } from \"#/functions/merge\";\n\nconst defineConfigFn = (\n userConfig?: OxlintConfig,\n presets?: Preset[],\n): OxlintConfig => {\n let config: OxlintConfig = mergeConfig(clone(CONFIG_DEFAULT), userConfig);\n\n if (!presets) return config;\n\n for (const preset of presets) {\n const presetResult: PresetResult = preset({\n config,\n });\n\n config = toMerged(config, presetResult.config);\n }\n\n return config;\n};\n\n/**\n * Define Oxlint configuration.\n *\n * ### Example\n *\n * ```ts\n * import { defineConfig } from \"@apst/oxlint\";\n * import { commonPreset } from \"@apst/oxlint/presets/common\";\n * import { reactPreset } from \"@apst/oxlint/presets/react\";\n *\n * export default defineConfig([\n * commonPreset(),\n * reactPreset(),\n * ]);\n * ```\n */\nfunction defineConfig(presets?: Preset[]): OxlintConfig;\n\n/**\n * Define Oxlint configuration.\n *\n * All arrays will not be merged, adding new values will replace existing values.\n *\n * ### Example\n *\n * ```ts\n * import { defineConfig } from \"@apst/oxlint\";\n * import { IGNORE_PATTERNS_DEFAULT } from \"@apst/oxlint/constants/ignore-patterns\";\n * import { commonPreset } from \"@apst/oxlint/presets/common\";\n * import { reactPreset } from \"@apst/oxlint/presets/react\";\n *\n * export default defineConfig({\n * ignorePatterns: [\n * ...IGNORE_PATTERNS_DEFAULT,\n * // ...\n * ],\n * }, [\n * commonPreset(),\n * reactPreset(),\n * ]);\n * ```\n */\nfunction defineConfig(config?: OxlintConfig, presets?: Preset[]): OxlintConfig;\n\nfunction defineConfig(\n presetsOrConfig?: Preset[] | OxlintConfig,\n optionalPresets?: Preset[],\n): OxlintConfig {\n const config: OxlintConfig | undefined = Array.isArray(presetsOrConfig)\n ? void 0\n : presetsOrConfig;\n\n const presets: Preset[] | undefined = Array.isArray(presetsOrConfig)\n ? presetsOrConfig\n : optionalPresets;\n\n return defineConfigFn(config, presets);\n}\n\nexport { defineConfig };\n"],"mappings":";;;;AASA,MAAM,kBACF,YACA,YACe;CACf,IAAI,SAAuBA,gDAAkBC,yCAAe,EAAE,WAAW;AAEzE,KAAI,CAAC,QAAS,QAAO;AAErB,MAAK,MAAM,UAAU,SAAS;EAC1B,MAAM,eAA6B,OAAO,EACtC,QACH,CAAC;AAEF,oCAAkB,QAAQ,aAAa,OAAO;;AAGlD,QAAO;;AA+CX,SAAS,aACL,iBACA,iBACY;AASZ,QAAO,eARkC,MAAM,QAAQ,gBAAgB,GACjE,KAAK,IACL,iBAEgC,MAAM,QAAQ,gBAAgB,GAC9D,kBACA,gBAEgC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CONFIG_DEFAULT } from "../constants/default.mjs";
|
|
2
|
+
import { mergeConfig } from "./merge.mjs";
|
|
3
|
+
import { clone, toMerged } from "es-toolkit";
|
|
4
|
+
|
|
5
|
+
const defineConfigFn = (userConfig, presets) => {
|
|
6
|
+
let config = mergeConfig(clone(CONFIG_DEFAULT), userConfig);
|
|
7
|
+
if (!presets) return config;
|
|
8
|
+
for (const preset of presets) {
|
|
9
|
+
const presetResult = preset({ config });
|
|
10
|
+
config = toMerged(config, presetResult.config);
|
|
11
|
+
}
|
|
12
|
+
return config;
|
|
13
|
+
};
|
|
14
|
+
function defineConfig(presetsOrConfig, optionalPresets) {
|
|
15
|
+
return defineConfigFn(Array.isArray(presetsOrConfig) ? void 0 : presetsOrConfig, Array.isArray(presetsOrConfig) ? presetsOrConfig : optionalPresets);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { defineConfig };
|
|
19
|
+
//# sourceMappingURL=define.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define.mjs","names":[],"sources":["../../src/functions/define.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\";\n\nimport type { Preset, PresetResult } from \"#/@types/preset\";\n\nimport { clone, toMerged } from \"es-toolkit\";\n\nimport { CONFIG_DEFAULT } from \"#/constants/default\";\nimport { mergeConfig } from \"#/functions/merge\";\n\nconst defineConfigFn = (\n userConfig?: OxlintConfig,\n presets?: Preset[],\n): OxlintConfig => {\n let config: OxlintConfig = mergeConfig(clone(CONFIG_DEFAULT), userConfig);\n\n if (!presets) return config;\n\n for (const preset of presets) {\n const presetResult: PresetResult = preset({\n config,\n });\n\n config = toMerged(config, presetResult.config);\n }\n\n return config;\n};\n\n/**\n * Define Oxlint configuration.\n *\n * ### Example\n *\n * ```ts\n * import { defineConfig } from \"@apst/oxlint\";\n * import { commonPreset } from \"@apst/oxlint/presets/common\";\n * import { reactPreset } from \"@apst/oxlint/presets/react\";\n *\n * export default defineConfig([\n * commonPreset(),\n * reactPreset(),\n * ]);\n * ```\n */\nfunction defineConfig(presets?: Preset[]): OxlintConfig;\n\n/**\n * Define Oxlint configuration.\n *\n * All arrays will not be merged, adding new values will replace existing values.\n *\n * ### Example\n *\n * ```ts\n * import { defineConfig } from \"@apst/oxlint\";\n * import { IGNORE_PATTERNS_DEFAULT } from \"@apst/oxlint/constants/ignore-patterns\";\n * import { commonPreset } from \"@apst/oxlint/presets/common\";\n * import { reactPreset } from \"@apst/oxlint/presets/react\";\n *\n * export default defineConfig({\n * ignorePatterns: [\n * ...IGNORE_PATTERNS_DEFAULT,\n * // ...\n * ],\n * }, [\n * commonPreset(),\n * reactPreset(),\n * ]);\n * ```\n */\nfunction defineConfig(config?: OxlintConfig, presets?: Preset[]): OxlintConfig;\n\nfunction defineConfig(\n presetsOrConfig?: Preset[] | OxlintConfig,\n optionalPresets?: Preset[],\n): OxlintConfig {\n const config: OxlintConfig | undefined = Array.isArray(presetsOrConfig)\n ? void 0\n : presetsOrConfig;\n\n const presets: Preset[] | undefined = Array.isArray(presetsOrConfig)\n ? presetsOrConfig\n : optionalPresets;\n\n return defineConfigFn(config, presets);\n}\n\nexport { defineConfig };\n"],"mappings":";;;;AASA,MAAM,kBACF,YACA,YACe;CACf,IAAI,SAAuB,YAAY,MAAM,eAAe,EAAE,WAAW;AAEzE,KAAI,CAAC,QAAS,QAAO;AAErB,MAAK,MAAM,UAAU,SAAS;EAC1B,MAAM,eAA6B,OAAO,EACtC,QACH,CAAC;AAEF,WAAS,SAAS,QAAQ,aAAa,OAAO;;AAGlD,QAAO;;AA+CX,SAAS,aACL,iBACA,iBACY;AASZ,QAAO,eARkC,MAAM,QAAQ,gBAAgB,GACjE,KAAK,IACL,iBAEgC,MAAM,QAAQ,gBAAgB,GAC9D,kBACA,gBAEgC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
let es_toolkit = require("es-toolkit");
|
|
2
|
+
|
|
3
|
+
const mergeConfig = (target, source) => {
|
|
4
|
+
if (!source) return target;
|
|
5
|
+
return (0, es_toolkit.mergeWith)(target, source, (_, target) => {
|
|
6
|
+
if (Array.isArray(target)) return target;
|
|
7
|
+
});
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
exports.mergeConfig = mergeConfig;
|
|
11
|
+
//# sourceMappingURL=merge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge.js","names":[],"sources":["../../src/functions/merge.ts"],"sourcesContent":["import { mergeWith } from \"es-toolkit\";\n\nconst mergeConfig = <\n T extends Record<PropertyKey, any>,\n S extends Record<PropertyKey, any>,\n>(\n target: T,\n source?: S,\n): T & S => {\n if (!source) return target;\n\n return mergeWith(target, source, (_: unknown, target: unknown): unknown => {\n // array replacement\n if (Array.isArray(target)) return target;\n // default deep merge\n return void 0;\n });\n};\n\nexport { mergeConfig };\n"],"mappings":";;AAEA,MAAM,eAIF,QACA,WACQ;AACR,KAAI,CAAC,OAAQ,QAAO;AAEpB,kCAAiB,QAAQ,SAAS,GAAY,WAA6B;AAEvE,MAAI,MAAM,QAAQ,OAAO,CAAE,QAAO;GAGpC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { mergeWith } from "es-toolkit";
|
|
2
|
+
|
|
3
|
+
const mergeConfig = (target, source) => {
|
|
4
|
+
if (!source) return target;
|
|
5
|
+
return mergeWith(target, source, (_, target) => {
|
|
6
|
+
if (Array.isArray(target)) return target;
|
|
7
|
+
});
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { mergeConfig };
|
|
11
|
+
//# sourceMappingURL=merge.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge.mjs","names":[],"sources":["../../src/functions/merge.ts"],"sourcesContent":["import { mergeWith } from \"es-toolkit\";\n\nconst mergeConfig = <\n T extends Record<PropertyKey, any>,\n S extends Record<PropertyKey, any>,\n>(\n target: T,\n source?: S,\n): T & S => {\n if (!source) return target;\n\n return mergeWith(target, source, (_: unknown, target: unknown): unknown => {\n // array replacement\n if (Array.isArray(target)) return target;\n // default deep merge\n return void 0;\n });\n};\n\nexport { mergeConfig };\n"],"mappings":";;AAEA,MAAM,eAIF,QACA,WACQ;AACR,KAAI,CAAC,OAAQ,QAAO;AAEpB,QAAO,UAAU,QAAQ,SAAS,GAAY,WAA6B;AAEvE,MAAI,MAAM,QAAQ,OAAO,CAAE,QAAO;GAGpC"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PLUGIN_COMMON } from "./plugin/index.js";
|
|
2
|
+
import { commonPreset } from "./preset/index.js";
|
|
3
|
+
import { RULES_ESLINT, RULES_ESLINT_NURSERY, RULES_ESLINT_PEDANTIC, RULES_ESLINT_PERF, RULES_ESLINT_RESTRICTION, RULES_ESLINT_STYLE, RULES_ESLINT_SUSPICIOUS } from "./rules/eslint.js";
|
|
4
|
+
import { RULES_IMPORT, RULES_IMPORT_CORRECTNESS, RULES_IMPORT_NURSERY, RULES_IMPORT_RESTRICTION, RULES_IMPORT_STYLE, RULES_IMPORT_SUSPICIOUS } from "./rules/import.js";
|
|
5
|
+
import { RULES_OXC, RULES_OXC_NURSERY, RULES_OXC_RESTRICTION } from "./rules/oxc.js";
|
|
6
|
+
import { RULES_PROMISE, RULES_PROMISE_CORRECTNESS, RULES_PROMISE_NURSERY, RULES_PROMISE_RESTRICTION, RULES_PROMISE_STYLE, RULES_PROMISE_SUSPICIOUS } from "./rules/promise.js";
|
|
7
|
+
import { RULES_TYPESCRIPT, RULES_TYPESCRIPT_NURSERY, RULES_TYPESCRIPT_PEDANTIC, RULES_TYPESCRIPT_RESTRICTION, RULES_TYPESCRIPT_STYLE, RULES_TYPESCRIPT_SUSPICIOUS } from "./rules/typescript.js";
|
|
8
|
+
import { RULES_UNICORN, RULES_UNICORN_PEDANTIC, RULES_UNICORN_RESTRICTION, RULES_UNICORN_STYLE, RULES_UNICORN_SUSPICIOUS } from "./rules/unicorn.js";
|
|
9
|
+
export { PLUGIN_COMMON, RULES_ESLINT, RULES_ESLINT_NURSERY, RULES_ESLINT_PEDANTIC, RULES_ESLINT_PERF, RULES_ESLINT_RESTRICTION, RULES_ESLINT_STYLE, RULES_ESLINT_SUSPICIOUS, RULES_IMPORT, RULES_IMPORT_CORRECTNESS, RULES_IMPORT_NURSERY, RULES_IMPORT_RESTRICTION, RULES_IMPORT_STYLE, RULES_IMPORT_SUSPICIOUS, RULES_OXC, RULES_OXC_NURSERY, RULES_OXC_RESTRICTION, RULES_PROMISE, RULES_PROMISE_CORRECTNESS, RULES_PROMISE_NURSERY, RULES_PROMISE_RESTRICTION, RULES_PROMISE_STYLE, RULES_PROMISE_SUSPICIOUS, RULES_TYPESCRIPT, RULES_TYPESCRIPT_NURSERY, RULES_TYPESCRIPT_PEDANTIC, RULES_TYPESCRIPT_RESTRICTION, RULES_TYPESCRIPT_STYLE, RULES_TYPESCRIPT_SUSPICIOUS, RULES_UNICORN, RULES_UNICORN_PEDANTIC, RULES_UNICORN_RESTRICTION, RULES_UNICORN_STYLE, RULES_UNICORN_SUSPICIOUS, commonPreset };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_index = require('./plugin/index.js');
|
|
3
|
+
const require_eslint = require('./rules/eslint.js');
|
|
4
|
+
const require_import = require('./rules/import.js');
|
|
5
|
+
const require_oxc = require('./rules/oxc.js');
|
|
6
|
+
const require_promise = require('./rules/promise.js');
|
|
7
|
+
const require_typescript = require('./rules/typescript.js');
|
|
8
|
+
const require_unicorn = require('./rules/unicorn.js');
|
|
9
|
+
const require_index$1 = require('./preset/index.js');
|
|
10
|
+
|
|
11
|
+
exports.PLUGIN_COMMON = require_index.PLUGIN_COMMON;
|
|
12
|
+
exports.RULES_ESLINT = require_eslint.RULES_ESLINT;
|
|
13
|
+
exports.RULES_ESLINT_NURSERY = require_eslint.RULES_ESLINT_NURSERY;
|
|
14
|
+
exports.RULES_ESLINT_PEDANTIC = require_eslint.RULES_ESLINT_PEDANTIC;
|
|
15
|
+
exports.RULES_ESLINT_PERF = require_eslint.RULES_ESLINT_PERF;
|
|
16
|
+
exports.RULES_ESLINT_RESTRICTION = require_eslint.RULES_ESLINT_RESTRICTION;
|
|
17
|
+
exports.RULES_ESLINT_STYLE = require_eslint.RULES_ESLINT_STYLE;
|
|
18
|
+
exports.RULES_ESLINT_SUSPICIOUS = require_eslint.RULES_ESLINT_SUSPICIOUS;
|
|
19
|
+
exports.RULES_IMPORT = require_import.RULES_IMPORT;
|
|
20
|
+
exports.RULES_IMPORT_CORRECTNESS = require_import.RULES_IMPORT_CORRECTNESS;
|
|
21
|
+
exports.RULES_IMPORT_NURSERY = require_import.RULES_IMPORT_NURSERY;
|
|
22
|
+
exports.RULES_IMPORT_RESTRICTION = require_import.RULES_IMPORT_RESTRICTION;
|
|
23
|
+
exports.RULES_IMPORT_STYLE = require_import.RULES_IMPORT_STYLE;
|
|
24
|
+
exports.RULES_IMPORT_SUSPICIOUS = require_import.RULES_IMPORT_SUSPICIOUS;
|
|
25
|
+
exports.RULES_OXC = require_oxc.RULES_OXC;
|
|
26
|
+
exports.RULES_OXC_NURSERY = require_oxc.RULES_OXC_NURSERY;
|
|
27
|
+
exports.RULES_OXC_RESTRICTION = require_oxc.RULES_OXC_RESTRICTION;
|
|
28
|
+
exports.RULES_PROMISE = require_promise.RULES_PROMISE;
|
|
29
|
+
exports.RULES_PROMISE_CORRECTNESS = require_promise.RULES_PROMISE_CORRECTNESS;
|
|
30
|
+
exports.RULES_PROMISE_NURSERY = require_promise.RULES_PROMISE_NURSERY;
|
|
31
|
+
exports.RULES_PROMISE_RESTRICTION = require_promise.RULES_PROMISE_RESTRICTION;
|
|
32
|
+
exports.RULES_PROMISE_STYLE = require_promise.RULES_PROMISE_STYLE;
|
|
33
|
+
exports.RULES_PROMISE_SUSPICIOUS = require_promise.RULES_PROMISE_SUSPICIOUS;
|
|
34
|
+
exports.RULES_TYPESCRIPT = require_typescript.RULES_TYPESCRIPT;
|
|
35
|
+
exports.RULES_TYPESCRIPT_NURSERY = require_typescript.RULES_TYPESCRIPT_NURSERY;
|
|
36
|
+
exports.RULES_TYPESCRIPT_PEDANTIC = require_typescript.RULES_TYPESCRIPT_PEDANTIC;
|
|
37
|
+
exports.RULES_TYPESCRIPT_RESTRICTION = require_typescript.RULES_TYPESCRIPT_RESTRICTION;
|
|
38
|
+
exports.RULES_TYPESCRIPT_STYLE = require_typescript.RULES_TYPESCRIPT_STYLE;
|
|
39
|
+
exports.RULES_TYPESCRIPT_SUSPICIOUS = require_typescript.RULES_TYPESCRIPT_SUSPICIOUS;
|
|
40
|
+
exports.RULES_UNICORN = require_unicorn.RULES_UNICORN;
|
|
41
|
+
exports.RULES_UNICORN_PEDANTIC = require_unicorn.RULES_UNICORN_PEDANTIC;
|
|
42
|
+
exports.RULES_UNICORN_RESTRICTION = require_unicorn.RULES_UNICORN_RESTRICTION;
|
|
43
|
+
exports.RULES_UNICORN_STYLE = require_unicorn.RULES_UNICORN_STYLE;
|
|
44
|
+
exports.RULES_UNICORN_SUSPICIOUS = require_unicorn.RULES_UNICORN_SUSPICIOUS;
|
|
45
|
+
exports.commonPreset = require_index$1.commonPreset;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PLUGIN_COMMON } from "./plugin/index.mjs";
|
|
2
|
+
import { RULES_ESLINT, RULES_ESLINT_NURSERY, RULES_ESLINT_PEDANTIC, RULES_ESLINT_PERF, RULES_ESLINT_RESTRICTION, RULES_ESLINT_STYLE, RULES_ESLINT_SUSPICIOUS } from "./rules/eslint.mjs";
|
|
3
|
+
import { RULES_IMPORT, RULES_IMPORT_CORRECTNESS, RULES_IMPORT_NURSERY, RULES_IMPORT_RESTRICTION, RULES_IMPORT_STYLE, RULES_IMPORT_SUSPICIOUS } from "./rules/import.mjs";
|
|
4
|
+
import { RULES_OXC, RULES_OXC_NURSERY, RULES_OXC_RESTRICTION } from "./rules/oxc.mjs";
|
|
5
|
+
import { RULES_PROMISE, RULES_PROMISE_CORRECTNESS, RULES_PROMISE_NURSERY, RULES_PROMISE_RESTRICTION, RULES_PROMISE_STYLE, RULES_PROMISE_SUSPICIOUS } from "./rules/promise.mjs";
|
|
6
|
+
import { RULES_TYPESCRIPT, RULES_TYPESCRIPT_NURSERY, RULES_TYPESCRIPT_PEDANTIC, RULES_TYPESCRIPT_RESTRICTION, RULES_TYPESCRIPT_STYLE, RULES_TYPESCRIPT_SUSPICIOUS } from "./rules/typescript.mjs";
|
|
7
|
+
import { RULES_UNICORN, RULES_UNICORN_PEDANTIC, RULES_UNICORN_RESTRICTION, RULES_UNICORN_STYLE, RULES_UNICORN_SUSPICIOUS } from "./rules/unicorn.mjs";
|
|
8
|
+
import { commonPreset } from "./preset/index.mjs";
|
|
9
|
+
|
|
10
|
+
export { PLUGIN_COMMON, RULES_ESLINT, RULES_ESLINT_NURSERY, RULES_ESLINT_PEDANTIC, RULES_ESLINT_PERF, RULES_ESLINT_RESTRICTION, RULES_ESLINT_STYLE, RULES_ESLINT_SUSPICIOUS, RULES_IMPORT, RULES_IMPORT_CORRECTNESS, RULES_IMPORT_NURSERY, RULES_IMPORT_RESTRICTION, RULES_IMPORT_STYLE, RULES_IMPORT_SUSPICIOUS, RULES_OXC, RULES_OXC_NURSERY, RULES_OXC_RESTRICTION, RULES_PROMISE, RULES_PROMISE_CORRECTNESS, RULES_PROMISE_NURSERY, RULES_PROMISE_RESTRICTION, RULES_PROMISE_STYLE, RULES_PROMISE_SUSPICIOUS, RULES_TYPESCRIPT, RULES_TYPESCRIPT_NURSERY, RULES_TYPESCRIPT_PEDANTIC, RULES_TYPESCRIPT_RESTRICTION, RULES_TYPESCRIPT_STYLE, RULES_TYPESCRIPT_SUSPICIOUS, RULES_UNICORN, RULES_UNICORN_PEDANTIC, RULES_UNICORN_RESTRICTION, RULES_UNICORN_STYLE, RULES_UNICORN_SUSPICIOUS, commonPreset };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/presets/common/plugin/index.ts"],"sourcesContent":["import type { LintPlugins } from \"#/@types/oxlint\";\n\nconst PLUGIN_COMMON = [\n \"eslint\",\n \"typescript\",\n \"unicorn\",\n \"oxc\",\n \"import\",\n \"promise\",\n] as const satisfies LintPlugins;\n\nexport { PLUGIN_COMMON };\n"],"mappings":";AAEA,MAAM,gBAAgB;CAClB;CACA;CACA;CACA;CACA;CACA;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/presets/common/plugin/index.ts"],"sourcesContent":["import type { LintPlugins } from \"#/@types/oxlint\";\n\nconst PLUGIN_COMMON = [\n \"eslint\",\n \"typescript\",\n \"unicorn\",\n \"oxc\",\n \"import\",\n \"promise\",\n] as const satisfies LintPlugins;\n\nexport { PLUGIN_COMMON };\n"],"mappings":"AAEA,MAAM,gBAAgB;CAClB;CACA;CACA;CACA;CACA;CACA;CACH"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const require_index = require('../plugin/index.js');
|
|
2
|
+
const require_eslint = require('../rules/eslint.js');
|
|
3
|
+
const require_import = require('../rules/import.js');
|
|
4
|
+
const require_oxc = require('../rules/oxc.js');
|
|
5
|
+
const require_promise = require('../rules/promise.js');
|
|
6
|
+
const require_typescript = require('../rules/typescript.js');
|
|
7
|
+
const require_unicorn = require('../rules/unicorn.js');
|
|
8
|
+
let es_toolkit = require("es-toolkit");
|
|
9
|
+
|
|
10
|
+
const commonPreset = () => {
|
|
11
|
+
return ({ config: internalConfig }) => {
|
|
12
|
+
return { config: (0, es_toolkit.toMerged)(internalConfig, {
|
|
13
|
+
plugins: [...require_index.PLUGIN_COMMON],
|
|
14
|
+
rules: {
|
|
15
|
+
...require_eslint.RULES_ESLINT,
|
|
16
|
+
...require_typescript.RULES_TYPESCRIPT,
|
|
17
|
+
...require_unicorn.RULES_UNICORN,
|
|
18
|
+
...require_oxc.RULES_OXC,
|
|
19
|
+
...require_import.RULES_IMPORT,
|
|
20
|
+
...require_promise.RULES_PROMISE
|
|
21
|
+
}
|
|
22
|
+
}) };
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
exports.commonPreset = commonPreset;
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["PLUGIN_COMMON","RULES_ESLINT","RULES_TYPESCRIPT","RULES_UNICORN","RULES_OXC","RULES_IMPORT","RULES_PROMISE"],"sources":["../../../../src/presets/common/preset/index.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\";\n\nimport type { Preset, PresetResult } from \"#/@types/preset\";\n\nimport { toMerged } from \"es-toolkit\";\n\nimport { PLUGIN_COMMON } from \"#/presets/common/plugin\";\nimport { RULES_ESLINT } from \"#/presets/common/rules/eslint\";\nimport { RULES_IMPORT } from \"#/presets/common/rules/import\";\nimport { RULES_OXC } from \"#/presets/common/rules/oxc\";\nimport { RULES_PROMISE } from \"#/presets/common/rules/promise\";\nimport { RULES_TYPESCRIPT } from \"#/presets/common/rules/typescript\";\nimport { RULES_UNICORN } from \"#/presets/common/rules/unicorn\";\n\nconst commonPreset = (): Preset => {\n return ({ config: internalConfig }): PresetResult => {\n const config: OxlintConfig = toMerged(internalConfig, {\n plugins: [\n ...PLUGIN_COMMON,\n ],\n rules: {\n ...RULES_ESLINT,\n ...RULES_TYPESCRIPT,\n ...RULES_UNICORN,\n ...RULES_OXC,\n ...RULES_IMPORT,\n ...RULES_PROMISE,\n },\n } satisfies OxlintConfig);\n\n return {\n config,\n };\n };\n};\n\nexport { commonPreset };\n"],"mappings":";;;;;;;;;AAcA,MAAM,qBAA6B;AAC/B,SAAQ,EAAE,QAAQ,qBAAmC;AAejD,SAAO,EACH,iCAfkC,gBAAgB;GAClD,SAAS,CACL,GAAGA,4BACN;GACD,OAAO;IACH,GAAGC;IACH,GAAGC;IACH,GAAGC;IACH,GAAGC;IACH,GAAGC;IACH,GAAGC;IACN;GACJ,CAAwB,EAIxB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PLUGIN_COMMON } from "../plugin/index.mjs";
|
|
2
|
+
import { RULES_ESLINT } from "../rules/eslint.mjs";
|
|
3
|
+
import { RULES_IMPORT } from "../rules/import.mjs";
|
|
4
|
+
import { RULES_OXC } from "../rules/oxc.mjs";
|
|
5
|
+
import { RULES_PROMISE } from "../rules/promise.mjs";
|
|
6
|
+
import { RULES_TYPESCRIPT } from "../rules/typescript.mjs";
|
|
7
|
+
import { RULES_UNICORN } from "../rules/unicorn.mjs";
|
|
8
|
+
import { toMerged } from "es-toolkit";
|
|
9
|
+
|
|
10
|
+
const commonPreset = () => {
|
|
11
|
+
return ({ config: internalConfig }) => {
|
|
12
|
+
return { config: toMerged(internalConfig, {
|
|
13
|
+
plugins: [...PLUGIN_COMMON],
|
|
14
|
+
rules: {
|
|
15
|
+
...RULES_ESLINT,
|
|
16
|
+
...RULES_TYPESCRIPT,
|
|
17
|
+
...RULES_UNICORN,
|
|
18
|
+
...RULES_OXC,
|
|
19
|
+
...RULES_IMPORT,
|
|
20
|
+
...RULES_PROMISE
|
|
21
|
+
}
|
|
22
|
+
}) };
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { commonPreset };
|
|
27
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/presets/common/preset/index.ts"],"sourcesContent":["import type { OxlintConfig } from \"oxlint\";\n\nimport type { Preset, PresetResult } from \"#/@types/preset\";\n\nimport { toMerged } from \"es-toolkit\";\n\nimport { PLUGIN_COMMON } from \"#/presets/common/plugin\";\nimport { RULES_ESLINT } from \"#/presets/common/rules/eslint\";\nimport { RULES_IMPORT } from \"#/presets/common/rules/import\";\nimport { RULES_OXC } from \"#/presets/common/rules/oxc\";\nimport { RULES_PROMISE } from \"#/presets/common/rules/promise\";\nimport { RULES_TYPESCRIPT } from \"#/presets/common/rules/typescript\";\nimport { RULES_UNICORN } from \"#/presets/common/rules/unicorn\";\n\nconst commonPreset = (): Preset => {\n return ({ config: internalConfig }): PresetResult => {\n const config: OxlintConfig = toMerged(internalConfig, {\n plugins: [\n ...PLUGIN_COMMON,\n ],\n rules: {\n ...RULES_ESLINT,\n ...RULES_TYPESCRIPT,\n ...RULES_UNICORN,\n ...RULES_OXC,\n ...RULES_IMPORT,\n ...RULES_PROMISE,\n },\n } satisfies OxlintConfig);\n\n return {\n config,\n };\n };\n};\n\nexport { commonPreset };\n"],"mappings":";;;;;;;;;AAcA,MAAM,qBAA6B;AAC/B,SAAQ,EAAE,QAAQ,qBAAmC;AAejD,SAAO,EACH,QAfyB,SAAS,gBAAgB;GAClD,SAAS,CACL,GAAG,cACN;GACD,OAAO;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACN;GACJ,CAAwB,EAIxB"}
|