@lincy/eslint-config 6.0.0 → 6.0.1
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.cjs +8 -8
- package/dist/index.d.cts +291 -147
- package/dist/{index.d.ts → index.d.mts} +291 -147
- package/dist/{index.js → index.mjs} +8 -3
- package/dist/{lib-B2tdYoXA.cjs → lib-BJFVxmuP.cjs} +828 -613
- package/dist/{lib-DMY_mkdT.js → lib-D3OsxTXr.mjs} +828 -632
- package/package.json +38 -37
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
const require_chunk = require('./chunk-DWy1uDak.cjs');
|
|
3
3
|
let eslint_flat_config_utils = require("eslint-flat-config-utils");
|
|
4
|
-
eslint_flat_config_utils = require_chunk.__toESM(eslint_flat_config_utils);
|
|
5
4
|
let local_pkg = require("local-pkg");
|
|
6
|
-
local_pkg = require_chunk.__toESM(local_pkg);
|
|
7
5
|
let __eslint_community_eslint_plugin_eslint_comments = require("@eslint-community/eslint-plugin-eslint-comments");
|
|
8
6
|
__eslint_community_eslint_plugin_eslint_comments = require_chunk.__toESM(__eslint_community_eslint_plugin_eslint_comments);
|
|
9
7
|
let eslint_plugin_antfu = require("eslint-plugin-antfu");
|
|
@@ -21,15 +19,12 @@ eslint_plugin_unused_imports = require_chunk.__toESM(eslint_plugin_unused_import
|
|
|
21
19
|
let node_process = require("node:process");
|
|
22
20
|
node_process = require_chunk.__toESM(node_process);
|
|
23
21
|
let node_url = require("node:url");
|
|
24
|
-
node_url = require_chunk.__toESM(node_url);
|
|
25
22
|
let globals = require("globals");
|
|
26
23
|
globals = require_chunk.__toESM(globals);
|
|
27
24
|
let eslint_merge_processors = require("eslint-merge-processors");
|
|
28
|
-
eslint_merge_processors = require_chunk.__toESM(eslint_merge_processors);
|
|
29
25
|
let eslint_parser_plain = require("eslint-parser-plain");
|
|
30
26
|
eslint_parser_plain = require_chunk.__toESM(eslint_parser_plain);
|
|
31
27
|
let eslint_plugin_regexp = require("eslint-plugin-regexp");
|
|
32
|
-
eslint_plugin_regexp = require_chunk.__toESM(eslint_plugin_regexp);
|
|
33
28
|
|
|
34
29
|
//#region src/configs/comments.ts
|
|
35
30
|
async function comments(options = {}) {
|
|
@@ -880,6 +875,11 @@ async function nextjs(options = {}) {
|
|
|
880
875
|
const { files = [GLOB_SRC], overrides = {} } = options;
|
|
881
876
|
await ensurePackages(["@next/eslint-plugin-next"]);
|
|
882
877
|
const pluginNextJS = await interopDefault(import("@next/eslint-plugin-next"));
|
|
878
|
+
function getRules(name) {
|
|
879
|
+
const rules = pluginNextJS.configs?.[name]?.rules;
|
|
880
|
+
if (!rules) throw new Error(`[@lincy/eslint-config] Failed to find config ${name} in @next/eslint-plugin-next`);
|
|
881
|
+
return normalizeRules(rules);
|
|
882
|
+
}
|
|
883
883
|
return [{
|
|
884
884
|
name: "eslint/nextjs/setup",
|
|
885
885
|
plugins: { next: pluginNextJS }
|
|
@@ -891,8 +891,8 @@ async function nextjs(options = {}) {
|
|
|
891
891
|
},
|
|
892
892
|
name: "eslint/nextjs/rules",
|
|
893
893
|
rules: {
|
|
894
|
-
...
|
|
895
|
-
...
|
|
894
|
+
...getRules("recommended"),
|
|
895
|
+
...getRules("core-web-vitals"),
|
|
896
896
|
...overrides
|
|
897
897
|
},
|
|
898
898
|
settings: { react: { version: "detect" } }
|
|
@@ -1631,7 +1631,7 @@ async function typescript(options = {}) {
|
|
|
1631
1631
|
}] : [],
|
|
1632
1632
|
...erasableOnly ? [{
|
|
1633
1633
|
name: "eslint/typescript/erasable-syntax-only",
|
|
1634
|
-
plugins: { "erasable-syntax-only": await interopDefault(Promise.resolve().then(() => require("./lib-
|
|
1634
|
+
plugins: { "erasable-syntax-only": await interopDefault(Promise.resolve().then(() => require("./lib-BJFVxmuP.cjs"))) },
|
|
1635
1635
|
rules: {
|
|
1636
1636
|
"erasable-syntax-only/enums": "error",
|
|
1637
1637
|
"erasable-syntax-only/import-aliases": "error",
|