@hexadrop/eslint-config 0.0.1-beta.8 → 0.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 +36 -22
- package/dist/index.d.cts +1582 -1258
- package/dist/index.d.ts +1582 -1258
- package/dist/index.js +36 -22
- package/package.json +43 -42
package/dist/index.cjs
CHANGED
|
@@ -334,9 +334,9 @@ async function json(options) {
|
|
|
334
334
|
[`${jsonPluginRename}/no-nan`]: "error",
|
|
335
335
|
[`${jsonPluginRename}/no-number-props`]: "error",
|
|
336
336
|
[`${jsonPluginRename}/no-numeric-separators`]: "error",
|
|
337
|
-
[`${jsonPluginRename}/no-octal`]: "error",
|
|
338
337
|
[`${jsonPluginRename}/no-octal-escape`]: "error",
|
|
339
338
|
[`${jsonPluginRename}/no-octal-numeric-literals`]: "error",
|
|
339
|
+
[`${jsonPluginRename}/no-octal`]: "error",
|
|
340
340
|
[`${jsonPluginRename}/no-parenthesized`]: "error",
|
|
341
341
|
[`${jsonPluginRename}/no-plus-sign`]: "error",
|
|
342
342
|
[`${jsonPluginRename}/no-regexp-literals`]: "error",
|
|
@@ -853,6 +853,7 @@ async function typescript(options) {
|
|
|
853
853
|
rules: {
|
|
854
854
|
...pluginConfigRules(plugin, "strict-type-checked-only", plugin_rename_typescript_default),
|
|
855
855
|
[`${typescriptPluginRename}/no-confusing-void-expression`]: ["error", { ignoreArrowShorthand: true }],
|
|
856
|
+
[`${typescriptPluginRename}/no-deprecated`]: "warn",
|
|
856
857
|
[`${typescriptPluginRename}/no-unused-vars`]: "off",
|
|
857
858
|
[`${typescriptPluginRename}/prefer-readonly`]: ["error"],
|
|
858
859
|
[`${typescriptPluginRename}/promise-function-async`]: ["error", { checkArrowFunctions: false }],
|
|
@@ -881,6 +882,7 @@ var IMPORTS_CONFIG_NAME_RULES_TYPESCRIPT = `${IMPORTS_CONFIG_NAME_RULES}/typescr
|
|
|
881
882
|
var IMPORTS_CONFIG_NAME_RULES_STATIC = `${IMPORTS_CONFIG_NAME_RULES}/static`;
|
|
882
883
|
var IMPORTS_CONFIG_NAME_RULES_STATIC_MARKDOWN_SOURCE = `${IMPORTS_CONFIG_NAME_RULES_STATIC}/markdown/source`;
|
|
883
884
|
var IMPORTS_CONFIG_NAME_RULES_STYLISTIC = `${IMPORTS_CONFIG_NAME_RULES}/stylistic`;
|
|
885
|
+
var IMPORTS_CONFIG_NAME_RULES_STYLISTIC_ASTRO = `${IMPORTS_CONFIG_NAME_RULES_STYLISTIC}/astro`;
|
|
884
886
|
var IMPORTS_CONFIG_NAME_RULES_STYLISTIC_TYPESCRIPT_DTS = `${IMPORTS_CONFIG_NAME_RULES_STYLISTIC}/typescript/dts`;
|
|
885
887
|
var IMPORTS_CONFIG_NAME_RULES_STYLISTIC_MARKDOWN_SOURCE = `${IMPORTS_CONFIG_NAME_RULES_STYLISTIC}/markdown/source`;
|
|
886
888
|
|
|
@@ -945,12 +947,12 @@ async function imports(options) {
|
|
|
945
947
|
rules: {
|
|
946
948
|
// Warnings rules https://github.com/un-ts/eslint-plugin-import-x?tab=readme-ov-file#helpful-warnings
|
|
947
949
|
[`${importXPluginRename}/export`]: "error",
|
|
948
|
-
[`${importXPluginRename}/no-deprecated`]: "
|
|
950
|
+
[`${importXPluginRename}/no-deprecated`]: "off",
|
|
949
951
|
[`${importXPluginRename}/no-empty-named-blocks`]: "error",
|
|
950
952
|
[`${importXPluginRename}/no-extraneous-dependencies`]: "error",
|
|
951
953
|
[`${importXPluginRename}/no-mutable-exports`]: "error",
|
|
952
|
-
[`${importXPluginRename}/no-named-as-default`]: "warn",
|
|
953
954
|
[`${importXPluginRename}/no-named-as-default-member`]: "warn",
|
|
955
|
+
[`${importXPluginRename}/no-named-as-default`]: "warn",
|
|
954
956
|
// Module system rules
|
|
955
957
|
...!amd && {
|
|
956
958
|
[`${importXPluginRename}/no-amd`]: "error"
|
|
@@ -997,8 +999,8 @@ async function imports(options) {
|
|
|
997
999
|
rules: {
|
|
998
1000
|
[`${importXPluginRename}/default`]: "off",
|
|
999
1001
|
[`${importXPluginRename}/no-deprecated`]: "off",
|
|
1000
|
-
[`${importXPluginRename}/no-named-as-default`]: "off",
|
|
1001
|
-
[`${importXPluginRename}/no-named-as-default
|
|
1002
|
+
[`${importXPluginRename}/no-named-as-default-member`]: "off",
|
|
1003
|
+
[`${importXPluginRename}/no-named-as-default`]: "off"
|
|
1002
1004
|
}
|
|
1003
1005
|
}
|
|
1004
1006
|
);
|
|
@@ -1062,7 +1064,7 @@ async function imports(options) {
|
|
|
1062
1064
|
configs.push({
|
|
1063
1065
|
files: DTS_GLOBS,
|
|
1064
1066
|
name: IMPORTS_CONFIG_NAME_RULES_STYLISTIC_TYPESCRIPT_DTS,
|
|
1065
|
-
|
|
1067
|
+
rules: {
|
|
1066
1068
|
[`${importXPluginRename}/prefer-default-export`]: "off"
|
|
1067
1069
|
}
|
|
1068
1070
|
});
|
|
@@ -1076,12 +1078,21 @@ async function imports(options) {
|
|
|
1076
1078
|
}
|
|
1077
1079
|
});
|
|
1078
1080
|
}
|
|
1081
|
+
if (astro2) {
|
|
1082
|
+
configs.push({
|
|
1083
|
+
files: GLOB_ASTRO,
|
|
1084
|
+
name: IMPORTS_CONFIG_NAME_RULES_STYLISTIC_ASTRO,
|
|
1085
|
+
rules: {
|
|
1086
|
+
[`${importXPluginRename}/exports-last`]: ["off"],
|
|
1087
|
+
[`${importXPluginRename}/prefer-default-export`]: ["off"]
|
|
1088
|
+
}
|
|
1089
|
+
});
|
|
1090
|
+
}
|
|
1079
1091
|
}
|
|
1080
1092
|
return configs;
|
|
1081
1093
|
}
|
|
1082
1094
|
|
|
1083
1095
|
// src/config/react/react.config.ts
|
|
1084
|
-
var import_compat = require("@eslint/compat");
|
|
1085
1096
|
var import_local_pkg = require("local-pkg");
|
|
1086
1097
|
|
|
1087
1098
|
// src/config/react/react.config-name.ts
|
|
@@ -1113,7 +1124,7 @@ async function react(options) {
|
|
|
1113
1124
|
{
|
|
1114
1125
|
name: REACT_CONFIG_NAME_SETUP,
|
|
1115
1126
|
plugins: {
|
|
1116
|
-
react:
|
|
1127
|
+
react: pluginReact,
|
|
1117
1128
|
"react-hooks": pluginReactHooks,
|
|
1118
1129
|
"react-refresh": pluginReactRefresh
|
|
1119
1130
|
},
|
|
@@ -1271,7 +1282,8 @@ async function stylistic(options) {
|
|
|
1271
1282
|
const pluginStylisticConfig = pluginStylistic.configs.customize(pluginStylisticOptions);
|
|
1272
1283
|
const pluginStylisticRules = pluginStylisticConfig.rules;
|
|
1273
1284
|
const pluginUnicorn = await interopDefault(import("eslint-plugin-unicorn"));
|
|
1274
|
-
const
|
|
1285
|
+
const pluginPerfectionistRoot = await interopDefault(import("eslint-plugin-perfectionist"));
|
|
1286
|
+
const pluginPerfectionist = pluginPerfectionistRoot.configs["recommended-natural"];
|
|
1275
1287
|
const config = [
|
|
1276
1288
|
{
|
|
1277
1289
|
name: STYLISTIC_CONFIG_NAME_SETUP,
|
|
@@ -1281,7 +1293,7 @@ async function stylistic(options) {
|
|
|
1281
1293
|
unicorn: pluginUnicorn
|
|
1282
1294
|
},
|
|
1283
1295
|
...perfectionist && {
|
|
1284
|
-
|
|
1296
|
+
...pluginPerfectionist.plugins
|
|
1285
1297
|
},
|
|
1286
1298
|
...format && {
|
|
1287
1299
|
format: await interopDefault(import("eslint-plugin-format"))
|
|
@@ -1293,9 +1305,10 @@ async function stylistic(options) {
|
|
|
1293
1305
|
rules: {
|
|
1294
1306
|
...renameRules(pluginStylisticRules, plugin_rename_default),
|
|
1295
1307
|
[`${stylisticPluginRename}/arrow-parens`]: ["error", "as-needed"],
|
|
1308
|
+
[`${stylisticPluginRename}/brace-style`]: "off",
|
|
1296
1309
|
[`${stylisticPluginRename}/implicit-arrow-linebreak`]: "off",
|
|
1297
|
-
[`${stylisticPluginRename}/indent`]: "off",
|
|
1298
1310
|
[`${stylisticPluginRename}/indent-binary-ops`]: "off",
|
|
1311
|
+
[`${stylisticPluginRename}/indent`]: "off",
|
|
1299
1312
|
[`${stylisticPluginRename}/jsx-closing-bracket-location`]: [
|
|
1300
1313
|
"error",
|
|
1301
1314
|
{
|
|
@@ -1745,9 +1758,9 @@ async function stylistic(options) {
|
|
|
1745
1758
|
{
|
|
1746
1759
|
allowList: {
|
|
1747
1760
|
Env: true,
|
|
1761
|
+
env: true,
|
|
1748
1762
|
ProcessEnv: true,
|
|
1749
|
-
Props: true
|
|
1750
|
-
env: true
|
|
1763
|
+
Props: true
|
|
1751
1764
|
}
|
|
1752
1765
|
}
|
|
1753
1766
|
]
|
|
@@ -1875,14 +1888,6 @@ var import_node_fs2 = require("fs");
|
|
|
1875
1888
|
var import_node_path = __toESM(require("path"), 1);
|
|
1876
1889
|
var import_node_process2 = __toESM(require("process"), 1);
|
|
1877
1890
|
var import_local_pkg2 = require("local-pkg");
|
|
1878
|
-
function getCwdTsconfigPath() {
|
|
1879
|
-
const root = import_node_process2.default.cwd();
|
|
1880
|
-
const cwdTsconfigPath = import_node_path.default.resolve(root, "tsconfig.json");
|
|
1881
|
-
if ((0, import_node_fs2.existsSync)(cwdTsconfigPath)) {
|
|
1882
|
-
return "tsconfig.json";
|
|
1883
|
-
}
|
|
1884
|
-
return void 0;
|
|
1885
|
-
}
|
|
1886
1891
|
function defaultOptions(options = {}) {
|
|
1887
1892
|
let typescript2 = false;
|
|
1888
1893
|
const installedTypescript = (0, import_local_pkg2.isPackageExists)("typescript");
|
|
@@ -1946,10 +1951,19 @@ function defaultOptions(options = {}) {
|
|
|
1946
1951
|
typescript: typescript2
|
|
1947
1952
|
};
|
|
1948
1953
|
}
|
|
1954
|
+
function getCwdTsconfigPath() {
|
|
1955
|
+
const root = import_node_process2.default.cwd();
|
|
1956
|
+
const cwdTsconfigPath = import_node_path.default.resolve(root, "tsconfig.json");
|
|
1957
|
+
if ((0, import_node_fs2.existsSync)(cwdTsconfigPath)) {
|
|
1958
|
+
return "tsconfig.json";
|
|
1959
|
+
}
|
|
1960
|
+
return void 0;
|
|
1961
|
+
}
|
|
1962
|
+
var hexadrop_eslint_options_default = defaultOptions;
|
|
1949
1963
|
|
|
1950
1964
|
// src/factory.ts
|
|
1951
1965
|
function hexadrop(optionsOrFlatConfigItem, ...configs) {
|
|
1952
|
-
const options =
|
|
1966
|
+
const options = hexadrop_eslint_options_default(optionsOrFlatConfigItem);
|
|
1953
1967
|
let pipeline = new import_eslint_flat_config_utils.FlatConfigComposer(
|
|
1954
1968
|
ignore(options),
|
|
1955
1969
|
core(options),
|