@shibanet0/datamitsu-config 0.0.1-alpha-8 → 0.0.1-alpha-10
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/bin/datamitsu.mjs +14 -8
- package/bin/tsc.mjs +8 -4
- package/bin/tsx.mjs +1 -1
- package/datamitsu.js +126 -69
- package/dist/array-func-M6KDQ7DN.js +14 -0
- package/dist/array-func-NPT6GB52.js +14 -0
- package/dist/clean-package/index.js +12 -4
- package/dist/eslint/index.d.ts +1 -0
- package/dist/eslint/index.js +309 -18
- package/dist/eslint/plugins/array-func.d.ts +2 -0
- package/dist/eslint/plugins/import.d.ts +2 -0
- package/dist/eslint/plugins/json-schema-validator.d.ts +2 -0
- package/dist/eslint/plugins/json.d.ts +2 -0
- package/dist/eslint/plugins/jsx-a11y.d.ts +2 -0
- package/dist/eslint/plugins/n.d.ts +2 -0
- package/dist/eslint/plugins/no-use-extend-native.d.ts +2 -0
- package/dist/eslint/plugins/perfectionist copy.d.ts +2 -0
- package/dist/eslint/plugins/playwright.d.ts +2 -0
- package/dist/eslint/plugins/prettier.d.ts +2 -0
- package/dist/eslint/plugins/promise.d.ts +2 -0
- package/dist/eslint/plugins/react copy.d.ts +2 -0
- package/dist/eslint/plugins/react-hooks.d.ts +2 -0
- package/dist/eslint/plugins/react-perf.d.ts +2 -0
- package/dist/eslint/plugins/react-prefer-function-component.d.ts +2 -0
- package/dist/eslint/plugins/react-refresh.d.ts +2 -0
- package/dist/eslint/plugins/react.d.ts +2 -0
- package/dist/eslint/plugins/security.d.ts +2 -0
- package/dist/eslint/plugins/sonarjs.d.ts +2 -0
- package/dist/eslint/plugins/storybook.d.ts +2 -0
- package/dist/eslint/plugins/toml.d.ts +2 -0
- package/dist/eslint/plugins/turbo.d.ts +2 -0
- package/dist/eslint/plugins/unicorn copy.d.ts +2 -0
- package/dist/eslint/plugins/unicorn.d.ts +2 -0
- package/dist/eslint/plugins/unused-imports.d.ts +2 -0
- package/dist/eslint/plugins/vanilla-extract.d.ts +2 -0
- package/dist/eslint/plugins/yml.d.ts +2 -0
- package/dist/json-LWTL4ZNK.js +18 -0
- package/dist/json-ZAIWY2QG.js +18 -0
- package/dist/jsx-a11y-DENBIOMT.js +7 -0
- package/dist/no-use-extend-native-WXT3EZT4.js +7 -0
- package/dist/no-use-extend-native-ZPCF5GPF.js +7 -0
- package/dist/playwright-BGT6YZAD.js +15 -0
- package/dist/playwright-EQJ74ILC.js +15 -0
- package/dist/prettier/index.js +1 -1
- package/dist/prettier-STALF5K5.js +7 -0
- package/dist/prettier-VWVEU6BH.js +7 -0
- package/dist/promise-4UOFB7NK.js +7 -0
- package/dist/promise-GMCQOXN6.js +7 -0
- package/dist/react-SBV4CSZW.js +10 -0
- package/dist/react-hooks-KCD4FRWS.js +7 -0
- package/dist/react-hooks-R6UCTUUG.js +7 -0
- package/dist/react-perf-I32W4SW7.js +7 -0
- package/dist/react-prefer-function-component-ZCGU3TJA.js +7 -0
- package/dist/security-QVOYXU25.js +7 -0
- package/dist/sonarjs-L2LS4QXC.js +16 -0
- package/dist/storybook-HBDSOOCR.js +7 -0
- package/dist/storybook-IFYU76LT.js +7 -0
- package/dist/toml-UYLTOG46.js +7 -0
- package/dist/toml-Y76F5J2F.js +7 -0
- package/dist/turbo-BF4PT2F4.js +7 -0
- package/dist/unicorn-CIVFI3IM.js +17 -0
- package/dist/unused-imports-7PV5NHDW.js +25 -0
- package/dist/unused-imports-PHM72DI2.js +25 -0
- package/dist/vanilla-extract-52HEEDJV.js +11 -0
- package/package.json +2 -2
package/bin/datamitsu.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { spawn } from "child_process";
|
|
4
|
-
import { join } from "path";
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
|
+
import { join } from "node:path";
|
|
5
5
|
|
|
6
6
|
import { getBinaryFilepath } from "./utils.mjs";
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const arguments_ = process.argv.slice(2);
|
|
9
9
|
|
|
10
|
-
if (!
|
|
11
|
-
|
|
10
|
+
if (!arguments_.includes("--binary-command")) {
|
|
11
|
+
arguments_.unshift("--binary-command", "datamitsu");
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const child = spawn(
|
|
@@ -17,7 +17,7 @@ const child = spawn(
|
|
|
17
17
|
getBinaryFilepath("@datamitsu/datamitsu/package.json", "../bin/index.js"),
|
|
18
18
|
"--config",
|
|
19
19
|
join(import.meta.dirname, "../datamitsu.js"),
|
|
20
|
-
...
|
|
20
|
+
...arguments_,
|
|
21
21
|
],
|
|
22
22
|
{
|
|
23
23
|
env: {
|
|
@@ -26,9 +26,15 @@ const child = spawn(
|
|
|
26
26
|
DATAMITSU_APP_ESLINT_BINARY_FILEPATH: getBinaryFilepath("eslint", "../../bin/eslint.js"),
|
|
27
27
|
DATAMITSU_APP_KNIP_BINARY_FILEPATH: getBinaryFilepath("knip", "../../bin/knip.js"),
|
|
28
28
|
DATAMITSU_APP_PRETTIER_BINARY_FILEPATH: getBinaryFilepath("prettier", "../bin/prettier.cjs"),
|
|
29
|
-
DATAMITSU_APP_SORT_PACKAGE_JSON_BINARY_FILEPATH: getBinaryFilepath(
|
|
29
|
+
DATAMITSU_APP_SORT_PACKAGE_JSON_BINARY_FILEPATH: getBinaryFilepath(
|
|
30
|
+
"sort-package-json",
|
|
31
|
+
"../cli.js",
|
|
32
|
+
),
|
|
30
33
|
DATAMITSU_APP_SYNCPACK_BINARY_FILEPATH: getBinaryFilepath("syncpack/index.cjs", ""),
|
|
31
|
-
DATAMITSU_APP_TSC_BINARY_FILEPATH: getBinaryFilepath(
|
|
34
|
+
DATAMITSU_APP_TSC_BINARY_FILEPATH: getBinaryFilepath(
|
|
35
|
+
"@typescript/native-preview/package.json",
|
|
36
|
+
"../bin/tsgo.js",
|
|
37
|
+
),
|
|
32
38
|
DATAMITSU_PACKAGE_NAME: process.env.DATAMITSU_PACKAGE_NAME || "@shibanet0/datamitsu-config",
|
|
33
39
|
},
|
|
34
40
|
stdio: "inherit",
|
package/bin/tsc.mjs
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { spawn } from "child_process";
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
4
|
|
|
5
5
|
import { getBinaryFilepath } from "./utils.mjs";
|
|
6
6
|
|
|
7
7
|
const args = process.argv.slice(2);
|
|
8
8
|
|
|
9
|
-
const child = spawn(
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const child = spawn(
|
|
10
|
+
"node",
|
|
11
|
+
[getBinaryFilepath("@typescript/native-preview/package.json", "../bin/tsgo.js"), ...args],
|
|
12
|
+
{
|
|
13
|
+
stdio: "inherit",
|
|
14
|
+
},
|
|
15
|
+
);
|
|
12
16
|
|
|
13
17
|
child.on("exit", (code) => {
|
|
14
18
|
if (code !== 0) {
|
package/bin/tsx.mjs
CHANGED
package/datamitsu.js
CHANGED
|
@@ -863,14 +863,14 @@ var mapOfApps = {
|
|
|
863
863
|
|
|
864
864
|
// package.json
|
|
865
865
|
var name = "@shibanet0/datamitsu-config";
|
|
866
|
-
var version = "0.0.1-alpha-
|
|
866
|
+
var version = "0.0.1-alpha-9";
|
|
867
867
|
var dependencies = {
|
|
868
868
|
"@antebudimir/eslint-plugin-vanilla-extract": "1.16.0",
|
|
869
869
|
"@commitlint/cli": "20.2.0",
|
|
870
870
|
"@commitlint/config-conventional": "20.2.0",
|
|
871
871
|
"@commitlint/format": "20.2.0",
|
|
872
872
|
"@commitlint/types": "20.2.0",
|
|
873
|
-
"@datamitsu/datamitsu": "0.0.1-alpha-
|
|
873
|
+
"@datamitsu/datamitsu": "0.0.1-alpha-22",
|
|
874
874
|
"@eslint/config-helpers": "0.5.0",
|
|
875
875
|
"@eslint/js": "9.39.2",
|
|
876
876
|
"@prettier/plugin-xml": "3.4.2",
|
|
@@ -1038,10 +1038,14 @@ var cleanDependencies = (deps) => {
|
|
|
1038
1038
|
return deps;
|
|
1039
1039
|
}
|
|
1040
1040
|
if (!deps) return;
|
|
1041
|
-
const excludeDependencyNameList = [
|
|
1041
|
+
const excludeDependencyNameList = /* @__PURE__ */ new Set([
|
|
1042
|
+
"@trivago/prettier-plugin-sort-imports",
|
|
1043
|
+
"typescript",
|
|
1044
|
+
...Object.keys(dependencies)
|
|
1045
|
+
]);
|
|
1042
1046
|
return Object.entries(deps).reduce(
|
|
1043
1047
|
(acc, [name2, version2]) => {
|
|
1044
|
-
if (!excludeDependencyNameList.
|
|
1048
|
+
if (!excludeDependencyNameList.has(name2)) {
|
|
1045
1049
|
acc[name2] = version2;
|
|
1046
1050
|
}
|
|
1047
1051
|
return acc;
|
|
@@ -1345,7 +1349,13 @@ var init = {
|
|
|
1345
1349
|
// delete-only configuration - removes deprecated config files without creating new ones
|
|
1346
1350
|
"deprecated-configs": {
|
|
1347
1351
|
deleteOnly: true,
|
|
1348
|
-
otherFileNameList: [
|
|
1352
|
+
otherFileNameList: [
|
|
1353
|
+
".babelrc",
|
|
1354
|
+
".babelrc.js",
|
|
1355
|
+
"babel.config.js",
|
|
1356
|
+
".editorconfig",
|
|
1357
|
+
".editorconfig-checker.json"
|
|
1358
|
+
]
|
|
1349
1359
|
},
|
|
1350
1360
|
"eslint.config.js": {
|
|
1351
1361
|
content: () => {
|
|
@@ -1395,7 +1405,12 @@ var init = {
|
|
|
1395
1405
|
...data
|
|
1396
1406
|
});
|
|
1397
1407
|
},
|
|
1398
|
-
otherFileNameList: [
|
|
1408
|
+
otherFileNameList: [
|
|
1409
|
+
".hadolint.yaml",
|
|
1410
|
+
"hadolint.yaml",
|
|
1411
|
+
".config/hadolint.yaml",
|
|
1412
|
+
".hadolint/hadolint.yaml"
|
|
1413
|
+
],
|
|
1399
1414
|
rootOnly: true
|
|
1400
1415
|
},
|
|
1401
1416
|
"knip.config.js": {
|
|
@@ -1654,6 +1669,10 @@ var projectTypes = {
|
|
|
1654
1669
|
description: "Node.js/npm project",
|
|
1655
1670
|
markers: ["package.json"]
|
|
1656
1671
|
},
|
|
1672
|
+
"typescript-project": {
|
|
1673
|
+
description: "",
|
|
1674
|
+
markers: ["tsconfig.json"]
|
|
1675
|
+
},
|
|
1657
1676
|
"pnpm-package": {
|
|
1658
1677
|
description: "pnpm project",
|
|
1659
1678
|
markers: ["pnpm-lock.yaml"]
|
|
@@ -1672,7 +1691,7 @@ var projectTypes = {
|
|
|
1672
1691
|
var indentSettings = {
|
|
1673
1692
|
typ: {
|
|
1674
1693
|
indentWidth: 2,
|
|
1675
|
-
lineWidth:
|
|
1694
|
+
lineWidth: 100
|
|
1676
1695
|
}
|
|
1677
1696
|
};
|
|
1678
1697
|
|
|
@@ -1690,26 +1709,52 @@ var prettierGlobs = [
|
|
|
1690
1709
|
"**/*.yaml",
|
|
1691
1710
|
"**/*.md"
|
|
1692
1711
|
];
|
|
1693
|
-
var eslintGlobs = [
|
|
1712
|
+
var eslintGlobs = [
|
|
1713
|
+
"**/*.js",
|
|
1714
|
+
"**/*.mjs",
|
|
1715
|
+
"**/*.cjs",
|
|
1716
|
+
"**/*.ts",
|
|
1717
|
+
"**/*.mts",
|
|
1718
|
+
"**/*.cts",
|
|
1719
|
+
"**/*.tsx"
|
|
1720
|
+
];
|
|
1694
1721
|
var toolsConfig = {
|
|
1695
1722
|
eslint: {
|
|
1696
1723
|
name: "Eslint",
|
|
1697
1724
|
operations: {
|
|
1698
1725
|
fix: {
|
|
1699
|
-
args: [
|
|
1726
|
+
args: [
|
|
1727
|
+
"--report-unused-inline-configs",
|
|
1728
|
+
"0",
|
|
1729
|
+
"--report-unused-disable-directives-severity",
|
|
1730
|
+
"0",
|
|
1731
|
+
"--fix",
|
|
1732
|
+
"--quiet",
|
|
1733
|
+
"--config",
|
|
1734
|
+
tools.Path.join(facts().cwd, "eslint.config.js"),
|
|
1735
|
+
"{files}"
|
|
1736
|
+
],
|
|
1700
1737
|
command: "eslint",
|
|
1701
1738
|
globs: eslintGlobs,
|
|
1702
|
-
mode: "
|
|
1739
|
+
mode: "batch",
|
|
1703
1740
|
priority: 0
|
|
1704
1741
|
},
|
|
1705
1742
|
lint: {
|
|
1706
|
-
args: [
|
|
1707
|
-
|
|
1743
|
+
args: [
|
|
1744
|
+
"--report-unused-inline-configs",
|
|
1745
|
+
"0",
|
|
1746
|
+
"--report-unused-disable-directives-severity",
|
|
1747
|
+
"0",
|
|
1748
|
+
"--config",
|
|
1749
|
+
tools.Path.join(facts().cwd, "eslint.config.js"),
|
|
1750
|
+
"{files}"
|
|
1751
|
+
],
|
|
1752
|
+
command: "eslint",
|
|
1708
1753
|
globs: eslintGlobs,
|
|
1709
|
-
mode: "
|
|
1754
|
+
mode: "batch"
|
|
1710
1755
|
}
|
|
1711
1756
|
},
|
|
1712
|
-
projectTypes: ["npm-package"]
|
|
1757
|
+
projectTypes: ["npm-package", "typescript-project"]
|
|
1713
1758
|
},
|
|
1714
1759
|
// gitleaks: {
|
|
1715
1760
|
// name: "gitleaks",
|
|
@@ -1723,27 +1768,27 @@ var toolsConfig = {
|
|
|
1723
1768
|
// },
|
|
1724
1769
|
// },
|
|
1725
1770
|
// },
|
|
1726
|
-
"golangci-lint": {
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
},
|
|
1771
|
+
// "golangci-lint": {
|
|
1772
|
+
// name: "golangci-lint - Go Linter",
|
|
1773
|
+
// operations: {
|
|
1774
|
+
// fix: {
|
|
1775
|
+
// args: ["run", "--fix"],
|
|
1776
|
+
// command: "golangci-lint",
|
|
1777
|
+
// globs: ["**/*.go"],
|
|
1778
|
+
// mode: "whole-project",
|
|
1779
|
+
// priority: 1,
|
|
1780
|
+
// rootOnly: true,
|
|
1781
|
+
// },
|
|
1782
|
+
// lint: {
|
|
1783
|
+
// args: ["run"],
|
|
1784
|
+
// command: "golangci-lint",
|
|
1785
|
+
// globs: ["**/*.go"],
|
|
1786
|
+
// mode: "whole-project",
|
|
1787
|
+
// rootOnly: true,
|
|
1788
|
+
// },
|
|
1789
|
+
// },
|
|
1790
|
+
// projectTypes: ["golang-package"],
|
|
1791
|
+
// },
|
|
1747
1792
|
// knip: {
|
|
1748
1793
|
// name: "Knip",
|
|
1749
1794
|
// operations: {
|
|
@@ -1754,26 +1799,38 @@ var toolsConfig = {
|
|
|
1754
1799
|
// mode: "whole-project",
|
|
1755
1800
|
// },
|
|
1756
1801
|
// },
|
|
1757
|
-
// projectTypes: ["npm-package"],
|
|
1802
|
+
// projectTypes: ["npm-package","typescript-project"],
|
|
1758
1803
|
// },
|
|
1759
1804
|
prettier: {
|
|
1760
1805
|
name: "Prettier - Code Formatter",
|
|
1761
1806
|
operations: {
|
|
1762
1807
|
fix: {
|
|
1763
|
-
args: [
|
|
1808
|
+
args: [
|
|
1809
|
+
"-u",
|
|
1810
|
+
"--write",
|
|
1811
|
+
"--config",
|
|
1812
|
+
tools.Path.join(facts().cwd, "prettier.config.js"),
|
|
1813
|
+
"{files}"
|
|
1814
|
+
],
|
|
1764
1815
|
command: "prettier",
|
|
1765
1816
|
globs: prettierGlobs,
|
|
1766
|
-
mode: "
|
|
1817
|
+
mode: "batch",
|
|
1767
1818
|
priority: 1
|
|
1768
1819
|
},
|
|
1769
1820
|
lint: {
|
|
1770
|
-
args: [
|
|
1821
|
+
args: [
|
|
1822
|
+
"-u",
|
|
1823
|
+
"--check",
|
|
1824
|
+
"--config",
|
|
1825
|
+
tools.Path.join(facts().cwd, "prettier.config.js"),
|
|
1826
|
+
"{files}"
|
|
1827
|
+
],
|
|
1771
1828
|
command: "prettier",
|
|
1772
1829
|
globs: prettierGlobs,
|
|
1773
|
-
mode: "
|
|
1830
|
+
mode: "batch"
|
|
1774
1831
|
}
|
|
1775
1832
|
},
|
|
1776
|
-
projectTypes: ["npm-package"]
|
|
1833
|
+
projectTypes: ["npm-package", "typescript-project"]
|
|
1777
1834
|
},
|
|
1778
1835
|
// hadolint: {
|
|
1779
1836
|
// name: "hadolint - Dockerfile Linter",
|
|
@@ -1833,41 +1890,41 @@ var toolsConfig = {
|
|
|
1833
1890
|
priority: 200
|
|
1834
1891
|
}
|
|
1835
1892
|
},
|
|
1836
|
-
projectTypes: ["npm-package"]
|
|
1893
|
+
projectTypes: ["npm-package", "typescript-project"]
|
|
1837
1894
|
},
|
|
1838
|
-
syncpack: {
|
|
1839
|
-
|
|
1840
|
-
operations: {
|
|
1841
|
-
fix: {
|
|
1842
|
-
args: ["fix", "--config", tools.Path.join(facts().gitRoot, ".syncpackrc.json")],
|
|
1843
|
-
command: "syncpack",
|
|
1844
|
-
globs: ["**/package.json"],
|
|
1845
|
-
mode: "whole-project",
|
|
1846
|
-
priority: 0
|
|
1847
|
-
},
|
|
1848
|
-
lint: {
|
|
1849
|
-
args: ["lint", "--config", tools.Path.join(facts().gitRoot, ".syncpackrc.json")],
|
|
1850
|
-
command: "syncpack",
|
|
1851
|
-
globs: ["**/package.json"],
|
|
1852
|
-
mode: "whole-project",
|
|
1853
|
-
priority: 0
|
|
1854
|
-
}
|
|
1855
|
-
},
|
|
1856
|
-
projectTypes: ["npm-package"]
|
|
1857
|
-
},
|
|
1858
|
-
// tsc: {
|
|
1859
|
-
// name: "Tsc",
|
|
1895
|
+
// syncpack: {
|
|
1896
|
+
// name: "syncpack",
|
|
1860
1897
|
// operations: {
|
|
1898
|
+
// fix: {
|
|
1899
|
+
// args: ["fix", "--config", tools.Path.join(facts().gitRoot, ".syncpackrc.json")],
|
|
1900
|
+
// command: "syncpack",
|
|
1901
|
+
// globs: ["**/package.json"],
|
|
1902
|
+
// mode: "whole-project",
|
|
1903
|
+
// priority: 0,
|
|
1904
|
+
// },
|
|
1861
1905
|
// lint: {
|
|
1862
|
-
// args: ["--
|
|
1863
|
-
// command: "
|
|
1864
|
-
// globs: ["
|
|
1906
|
+
// args: ["lint", "--config", tools.Path.join(facts().gitRoot, ".syncpackrc.json")],
|
|
1907
|
+
// command: "syncpack",
|
|
1908
|
+
// globs: ["**/package.json"],
|
|
1865
1909
|
// mode: "whole-project",
|
|
1866
|
-
// priority:
|
|
1910
|
+
// priority: 0,
|
|
1867
1911
|
// },
|
|
1868
1912
|
// },
|
|
1869
|
-
// projectTypes: ["npm-package"],
|
|
1913
|
+
// projectTypes: ["npm-package","typescript-project"],
|
|
1870
1914
|
// },
|
|
1915
|
+
tsc: {
|
|
1916
|
+
name: "Tsc",
|
|
1917
|
+
operations: {
|
|
1918
|
+
lint: {
|
|
1919
|
+
args: ["--noEmit"],
|
|
1920
|
+
command: "tsc",
|
|
1921
|
+
globs: ["**/*.d.ts", "**/*.ts", "**/*.mts", "**/*.cts", "**/*.tsx"],
|
|
1922
|
+
mode: "whole-project",
|
|
1923
|
+
priority: 200
|
|
1924
|
+
}
|
|
1925
|
+
},
|
|
1926
|
+
projectTypes: ["typescript-project"]
|
|
1927
|
+
},
|
|
1871
1928
|
// "editorconfig-checker": {
|
|
1872
1929
|
// name: "EditorConfig Checker",
|
|
1873
1930
|
// operations: {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/eslint/plugins/array-func.ts
|
|
2
|
+
import "@eslint/config-helpers";
|
|
3
|
+
import arrayFunc from "eslint-plugin-array-func";
|
|
4
|
+
var arrayFuncRules = [
|
|
5
|
+
arrayFunc.configs.recommended,
|
|
6
|
+
{
|
|
7
|
+
rules: {
|
|
8
|
+
"array-func/prefer-array-from": "off"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
];
|
|
12
|
+
export {
|
|
13
|
+
arrayFuncRules
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/eslint/plugins/array-func.ts
|
|
2
|
+
import arrayFunc from "eslint-plugin-array-func";
|
|
3
|
+
import "@eslint/config-helpers";
|
|
4
|
+
var arrayFuncRules = [
|
|
5
|
+
arrayFunc.configs.recommended,
|
|
6
|
+
{
|
|
7
|
+
rules: {
|
|
8
|
+
"array-func/prefer-array-from": "off"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
];
|
|
12
|
+
export {
|
|
13
|
+
arrayFuncRules
|
|
14
|
+
};
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
// src/clean-package/index.ts
|
|
2
2
|
import { readFileSync, writeFileSync } from "fs";
|
|
3
3
|
import { resolve } from "path";
|
|
4
|
-
var DEFAULT_FIELDS_TO_REMOVE = [
|
|
4
|
+
var DEFAULT_FIELDS_TO_REMOVE = [
|
|
5
|
+
"scripts",
|
|
6
|
+
"devDependencies",
|
|
7
|
+
"packageManager"
|
|
8
|
+
];
|
|
5
9
|
var cleanPackage = (options = {}) => {
|
|
6
|
-
const {
|
|
10
|
+
const {
|
|
11
|
+
dryRun = false,
|
|
12
|
+
fieldsToRemove = DEFAULT_FIELDS_TO_REMOVE,
|
|
13
|
+
packagePath = "package.json"
|
|
14
|
+
} = options;
|
|
7
15
|
const absolutePath = resolve(process.cwd(), packagePath);
|
|
8
16
|
try {
|
|
9
|
-
const packageJson = JSON.parse(readFileSync(absolutePath, "
|
|
17
|
+
const packageJson = JSON.parse(readFileSync(absolutePath, "utf8"));
|
|
10
18
|
const cleaned = { ...packageJson };
|
|
11
19
|
for (const field of fieldsToRemove) {
|
|
12
20
|
delete cleaned[field];
|
|
@@ -16,7 +24,7 @@ var cleanPackage = (options = {}) => {
|
|
|
16
24
|
console.log("Cleaned package.json:", JSON.stringify(cleaned, null, 2));
|
|
17
25
|
return;
|
|
18
26
|
}
|
|
19
|
-
writeFileSync(absolutePath, JSON.stringify(cleaned, null, 2) + "\n", "
|
|
27
|
+
writeFileSync(absolutePath, JSON.stringify(cleaned, null, 2) + "\n", "utf8");
|
|
20
28
|
console.log(`\u2713 Cleaned ${packagePath}, removed fields:`, fieldsToRemove);
|
|
21
29
|
} catch (error) {
|
|
22
30
|
console.error(`Error cleaning package.json:`, error);
|
package/dist/eslint/index.d.ts
CHANGED