@shibanet0/datamitsu-config 0.0.1-alpha-9 → 0.0.1-alpha-11

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.
Files changed (81) hide show
  1. package/bin/datamitsu.mjs +15 -8
  2. package/bin/tsc.mjs +8 -4
  3. package/bin/tsx.mjs +1 -1
  4. package/datamitsu.js +343 -101
  5. package/dist/array-func-M6KDQ7DN.js +14 -0
  6. package/dist/array-func-NPT6GB52.js +14 -0
  7. package/dist/chunk-7PGRJISO.js +24 -0
  8. package/dist/clean-package/index.js +12 -4
  9. package/dist/dist-SV6KNVWH.js +145 -0
  10. package/dist/eslint/globs.d.ts +16 -0
  11. package/dist/eslint/index.d.ts +1 -0
  12. package/dist/eslint/index.js +954 -55
  13. package/dist/eslint/plugins/array-func.d.ts +2 -0
  14. package/dist/eslint/plugins/arrayFunc.d.ts +2 -0
  15. package/dist/eslint/plugins/deMorgan.d.ts +2 -0
  16. package/dist/eslint/plugins/import.d.ts +2 -0
  17. package/dist/eslint/plugins/javascript.d.ts +2 -0
  18. package/dist/eslint/plugins/json-schema-validator.d.ts +2 -0
  19. package/dist/eslint/plugins/json.d.ts +2 -0
  20. package/dist/eslint/plugins/jsx-a11y.d.ts +2 -0
  21. package/dist/eslint/plugins/n.d.ts +4 -0
  22. package/dist/eslint/plugins/no-use-extend-native.d.ts +2 -0
  23. package/dist/eslint/plugins/perfectionist copy.d.ts +2 -0
  24. package/dist/eslint/plugins/perfectionist.d.ts +2 -2
  25. package/dist/eslint/plugins/playwright.d.ts +2 -0
  26. package/dist/eslint/plugins/prettier.d.ts +2 -0
  27. package/dist/eslint/plugins/promise.d.ts +2 -0
  28. package/dist/eslint/plugins/react copy.d.ts +2 -0
  29. package/dist/eslint/plugins/react-hooks.d.ts +2 -0
  30. package/dist/eslint/plugins/react-perf.d.ts +2 -0
  31. package/dist/eslint/plugins/react-prefer-function-component.d.ts +2 -0
  32. package/dist/eslint/plugins/react-refresh.d.ts +2 -0
  33. package/dist/eslint/plugins/react.d.ts +2 -0
  34. package/dist/eslint/plugins/security.d.ts +2 -0
  35. package/dist/eslint/plugins/sonarjs.d.ts +2 -0
  36. package/dist/eslint/plugins/storybook.d.ts +2 -0
  37. package/dist/eslint/plugins/toml.d.ts +2 -0
  38. package/dist/eslint/plugins/turbo.d.ts +2 -0
  39. package/dist/eslint/plugins/typescript.d.ts +2 -0
  40. package/dist/eslint/plugins/unicorn copy.d.ts +2 -0
  41. package/dist/eslint/plugins/unicorn.d.ts +2 -0
  42. package/dist/eslint/plugins/unused-imports.d.ts +2 -0
  43. package/dist/eslint/plugins/vanilla-extract.d.ts +2 -0
  44. package/dist/eslint/plugins/yml.d.ts +2 -0
  45. package/dist/eslint/types.d.ts +34 -0
  46. package/dist/globs/globs.d.ts +1 -0
  47. package/dist/json-LWTL4ZNK.js +18 -0
  48. package/dist/json-ZAIWY2QG.js +18 -0
  49. package/dist/jsx-a11y-DENBIOMT.js +7 -0
  50. package/dist/no-use-extend-native-WXT3EZT4.js +7 -0
  51. package/dist/no-use-extend-native-ZPCF5GPF.js +7 -0
  52. package/dist/oxlint/index.d.ts +2 -0
  53. package/dist/playwright-BGT6YZAD.js +15 -0
  54. package/dist/playwright-EQJ74ILC.js +15 -0
  55. package/dist/prettier/index.js +1 -1
  56. package/dist/prettier-STALF5K5.js +7 -0
  57. package/dist/prettier-VWVEU6BH.js +7 -0
  58. package/dist/promise-4UOFB7NK.js +7 -0
  59. package/dist/promise-GMCQOXN6.js +7 -0
  60. package/dist/react-QIEZHZI3.js +61 -0
  61. package/dist/react-SBV4CSZW.js +10 -0
  62. package/dist/react-hooks-KCD4FRWS.js +7 -0
  63. package/dist/react-hooks-R6UCTUUG.js +7 -0
  64. package/dist/react-perf-I32W4SW7.js +7 -0
  65. package/dist/react-prefer-function-component-ZCGU3TJA.js +7 -0
  66. package/dist/security-QVOYXU25.js +7 -0
  67. package/dist/sonarjs-L2LS4QXC.js +16 -0
  68. package/dist/storybook-HBDSOOCR.js +7 -0
  69. package/dist/storybook-IETULN4Z.js +8 -0
  70. package/dist/storybook-IFYU76LT.js +7 -0
  71. package/dist/toml-UYLTOG46.js +7 -0
  72. package/dist/toml-Y76F5J2F.js +7 -0
  73. package/dist/turbo-BF4PT2F4.js +7 -0
  74. package/dist/turbo-ZBSVFMOO.js +23 -0
  75. package/dist/unicorn-CIVFI3IM.js +17 -0
  76. package/dist/unused-imports-7PV5NHDW.js +25 -0
  77. package/dist/unused-imports-GCXR6T7K.js +31 -0
  78. package/dist/unused-imports-PHM72DI2.js +25 -0
  79. package/dist/vanilla-extract-52HEEDJV.js +11 -0
  80. package/oxlint_configuration_schema.json +712 -0
  81. package/package.json +12 -4
@@ -0,0 +1,24 @@
1
+ // src/eslint/plugins/storybook.ts
2
+ import "@eslint/config-helpers";
3
+ import "eslint-plugin-storybook";
4
+ var storybookRules = storybook.configs["flat/recommended"];
5
+ async function storybook() {
6
+ const plugin = await import("eslint-plugin-storybook");
7
+ console.log(">>>>", plugin.default.configs["flat/recommended"]);
8
+ return [
9
+ // {
10
+ // name: "shibanet0/storybook/rules",
11
+ // plugins: {
12
+ // storybook: plugin.default,
13
+ // },
14
+ // rules: {
15
+ // ...plugin.default.configs["flat/recommended"].map(el=>el.rules),
16
+ // },
17
+ // },
18
+ ];
19
+ }
20
+
21
+ export {
22
+ storybookRules,
23
+ storybook
24
+ };
@@ -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 = ["scripts", "devDependencies", "packageManager"];
4
+ var DEFAULT_FIELDS_TO_REMOVE = [
5
+ "scripts",
6
+ "devDependencies",
7
+ "packageManager"
8
+ ];
5
9
  var cleanPackage = (options = {}) => {
6
- const { dryRun = false, fieldsToRemove = DEFAULT_FIELDS_TO_REMOVE, packagePath = "package.json" } = options;
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, "utf-8"));
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", "utf-8");
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);
@@ -0,0 +1,145 @@
1
+ // ../../../../Library/pnpm/store/v10/links/eslint-plugin-unused-imports/4.3.0/a3da1d10a18945ddc6e862b5d66008b63149462a15f7eaa5392918a3262b9e2b/node_modules/eslint-plugin-unused-imports/dist/index.mjs
2
+ import { createRequire } from "module";
3
+ var commaFilter = { filter: (token) => token.value === "," };
4
+ var includeCommentsFilter = { includeComments: true };
5
+ function isUsedInJSDoc(identifierName, sourceCode) {
6
+ const comments = sourceCode.getAllComments();
7
+ const jsdocPattern = new RegExp(
8
+ // {@link Name} or @see Name
9
+ `(?:@(?:link|linkcode|linkplain|see)\\s+${identifierName}\\b)|(?:\\{@(?:link|linkcode|linkplain)\\s+${identifierName}\\b\\})|(?:[@{](?:type|typedef|param|returns?|template|augments|extends|implements)\\s+[^}]*\\b${identifierName}\\b)`
10
+ );
11
+ return comments.some((comment) => {
12
+ if (comment.type !== "Block") {
13
+ return false;
14
+ }
15
+ return jsdocPattern.test(comment.value);
16
+ });
17
+ }
18
+ function makePredicate(isImport, addFixer) {
19
+ return (problem, context) => {
20
+ const sourceCode = context.sourceCode || context.getSourceCode();
21
+ const node = problem.node ?? // typescript-eslint >= 7.8 sets a range instead of a node
22
+ sourceCode.getNodeByRangeIndex(sourceCode.getIndexFromLoc(problem.loc.start));
23
+ const { parent } = node;
24
+ if (parent && /^Import(|Default|Namespace)Specifier$/.test(parent.type) && isImport) {
25
+ const identifierName = node.name;
26
+ if (identifierName && isUsedInJSDoc(identifierName, sourceCode)) {
27
+ return false;
28
+ }
29
+ }
30
+ return parent ? /^Import(|Default|Namespace)Specifier$/.test(parent.type) == isImport ? Object.assign(problem, addFixer?.(parent, sourceCode)) : false : isImport ? false : problem;
31
+ };
32
+ }
33
+ var unusedVarsPredicate = makePredicate(false);
34
+ var unusedImportsPredicate = makePredicate(true, (parent, sourceCode) => ({
35
+ fix(fixer) {
36
+ const grandParent = parent.parent;
37
+ if (!grandParent) {
38
+ return null;
39
+ }
40
+ if (grandParent.specifiers.length === 1) {
41
+ const nextToken = sourceCode.getTokenAfter(grandParent, includeCommentsFilter);
42
+ const newLinesBetween = nextToken ? nextToken.loc.start.line - grandParent.loc.start.line : 0;
43
+ const endOfReplaceRange = nextToken ? nextToken.range[0] : grandParent.range[1];
44
+ const count = Math.max(0, newLinesBetween - 1);
45
+ return [
46
+ fixer.remove(grandParent),
47
+ fixer.replaceTextRange(
48
+ [grandParent.range[1], endOfReplaceRange],
49
+ "\n".repeat(count)
50
+ )
51
+ ];
52
+ }
53
+ if (parent !== grandParent.specifiers[grandParent.specifiers.length - 1]) {
54
+ const comma = sourceCode.getTokenAfter(parent, commaFilter);
55
+ const prevNode = sourceCode.getTokenBefore(parent);
56
+ return [
57
+ fixer.removeRange([prevNode.range[1], parent.range[0]]),
58
+ fixer.remove(parent),
59
+ fixer.remove(comma)
60
+ ];
61
+ }
62
+ if (grandParent.specifiers.filter((specifier) => specifier.type === "ImportSpecifier").length === 1) {
63
+ const start = sourceCode.getTokenBefore(parent, commaFilter);
64
+ const end = sourceCode.getTokenAfter(parent, {
65
+ filter: (token) => token.value === "}"
66
+ });
67
+ return fixer.removeRange([start.range[0], end.range[1]]);
68
+ }
69
+ return fixer.removeRange([
70
+ sourceCode.getTokenBefore(parent, commaFilter).range[0],
71
+ parent.range[1]
72
+ ]);
73
+ }
74
+ }));
75
+ function createRuleWithPredicate(name, baseRule, predicate) {
76
+ return {
77
+ ...baseRule,
78
+ meta: {
79
+ ...baseRule.meta,
80
+ fixable: "code",
81
+ docs: {
82
+ ...baseRule.meta?.docs,
83
+ url: `https://github.com/sweepline/eslint-plugin-unused-imports/blob/master/docs/rules/${name}.md`
84
+ }
85
+ },
86
+ create(context) {
87
+ return baseRule.create(
88
+ Object.create(context, {
89
+ report: {
90
+ enumerable: true,
91
+ value(problem) {
92
+ const result = predicate(problem, context);
93
+ if (result) {
94
+ context.report(result);
95
+ }
96
+ }
97
+ }
98
+ })
99
+ );
100
+ }
101
+ };
102
+ }
103
+ var rule;
104
+ var require2 = createRequire(import.meta.url);
105
+ function getBaseRule() {
106
+ if (!rule) {
107
+ rule = getRuleFromTSLintPlugin() ?? getRuleFromTSLint() ?? getESLintBaseRule();
108
+ }
109
+ return rule;
110
+ }
111
+ function getRuleFromTSLintPlugin() {
112
+ try {
113
+ const tslintPlugin = require2("@typescript-eslint/eslint-plugin");
114
+ return tslintPlugin.rules["no-unused-vars"];
115
+ } catch (_) {
116
+ return null;
117
+ }
118
+ }
119
+ function getRuleFromTSLint() {
120
+ try {
121
+ const tslint = require2("typescript-eslint");
122
+ return tslint.plugin.rules["no-unused-vars"];
123
+ } catch (_) {
124
+ return null;
125
+ }
126
+ }
127
+ function getESLintBaseRule() {
128
+ const eslint = require2("eslint");
129
+ return new eslint.Linter({ configType: "eslintrc" }).getRules().get("no-unused-vars");
130
+ }
131
+ var no_unused_vars_default = createRuleWithPredicate("no-unused-vars", getBaseRule(), unusedVarsPredicate);
132
+ var no_unused_imports_default = createRuleWithPredicate("no-unused-imports", getBaseRule(), unusedImportsPredicate);
133
+ var plugin = {
134
+ meta: {
135
+ name: "unused-imports"
136
+ },
137
+ rules: {
138
+ "no-unused-vars": no_unused_vars_default,
139
+ "no-unused-imports": no_unused_imports_default
140
+ }
141
+ };
142
+ var index_default = plugin;
143
+ export {
144
+ index_default as default
145
+ };
@@ -0,0 +1,16 @@
1
+ export declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
2
+ export declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
3
+ export declare const GLOB_JS = "**/*.?([cm])js";
4
+ export declare const GLOB_JSX = "**/*.?([cm])jsx";
5
+ export declare const GLOB_TS = "**/*.?([cm])ts";
6
+ export declare const GLOB_TSX = "**/*.?([cm])tsx";
7
+ export declare const GLOB_STYLE = "**/*.{c,le,sc}ss";
8
+ export declare const GLOB_CSS = "**/*.css";
9
+ export declare const GLOB_POSTCSS = "**/*.{p,post}css";
10
+ export declare const GLOB_LESS = "**/*.less";
11
+ export declare const GLOB_SCSS = "**/*.scss";
12
+ export declare const GLOB_JSON = "**/*.json";
13
+ export declare const GLOB_JSON5 = "**/*.json5";
14
+ export declare const GLOB_JSONC = "**/*.jsonc";
15
+ export declare const GLOB_ALL_SRC: string[];
16
+ export declare const GLOB_EXCLUDE: string[];
@@ -1,2 +1,3 @@
1
1
  import type { DefineConfigFn } from "./types";
2
+ export { globalIgnores } from "@eslint/config-helpers";
2
3
  export declare const defineConfig: DefineConfigFn;