@imranbarbhuiya/oxc-config 0.1.10 → 0.1.12

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.
@@ -1,3 +1,5 @@
1
+ import { definePlugin, defineRule } from "@oxlint/plugins";
2
+
1
3
  //#region src/plugins/restricted-syntax.ts
2
4
  function restrictionSelector(restriction) {
3
5
  return typeof restriction === "string" ? restriction : restriction.selector;
@@ -6,57 +8,108 @@ function restrictionMessage(restriction) {
6
8
  if (typeof restriction === "string") return `Using '${restriction}' is not allowed.`;
7
9
  return restriction.message ?? `Using '${restriction.selector}' is not allowed.`;
8
10
  }
9
- const plugin = {
11
+ function isAstNode(value) {
12
+ return typeof value === "object" && value !== null && "type" in value && typeof value.type === "string";
13
+ }
14
+ function pathValue(node, path) {
15
+ let current = node;
16
+ for (const part of path.split(".")) {
17
+ if (current == null || typeof current !== "object") return void 0;
18
+ current = current[part];
19
+ }
20
+ return current;
21
+ }
22
+ function matchAttributes(node, attributes) {
23
+ for (const attribute of attributes.matchAll(/\[([^\]]+)\]/g)) {
24
+ const expression = attribute[1];
25
+ const equal = /^(.+?)=(?:'([^']*)'|"([^"]*)")$/.exec(expression);
26
+ if (!equal) return false;
27
+ if (String(pathValue(node, equal[1].trim())) !== (equal[2] ?? equal[3])) return false;
28
+ }
29
+ return true;
30
+ }
31
+ function matchSimple(node, simple) {
32
+ const type = /^(?<type>[A-Za-z]+)/.exec(simple)?.groups?.type;
33
+ if (!type || node.type !== type) return false;
34
+ const not = /:not\((?<inner>[^)]*)\)/.exec(simple);
35
+ if (not?.groups?.inner && matchAttributes(node, not.groups.inner)) return false;
36
+ return matchAttributes(node, simple.replace(/:not\([^)]*\)/g, ""));
37
+ }
38
+ function matchSelector(node, selector) {
39
+ const parts = selector.split(/\s*>\s*/);
40
+ let current = node;
41
+ for (let index = parts.length - 1; index >= 0; index--) {
42
+ if (!current || !matchSimple(current, parts[index] ?? "")) return false;
43
+ current = index > 0 ? current.parent : current;
44
+ }
45
+ return true;
46
+ }
47
+ function walk(node, visit, seen = /* @__PURE__ */ new Set()) {
48
+ if (seen.has(node)) return;
49
+ seen.add(node);
50
+ visit(node);
51
+ for (const key of Object.keys(node)) {
52
+ if (key === "parent" || key === "loc" || key === "range") continue;
53
+ const child = node[key];
54
+ if (Array.isArray(child)) {
55
+ for (const item of child) if (isAstNode(item)) walk(item, visit, seen);
56
+ } else if (isAstNode(child)) walk(child, visit, seen);
57
+ }
58
+ }
59
+ const noRestrictedSyntax = defineRule({
10
60
  meta: {
11
- name: "eslint-plugin-mahir-restricted-syntax",
12
- version: "1.0.0"
13
- },
14
- rules: { "no-restricted-syntax": {
15
- meta: {
16
- type: "suggestion",
17
- docs: { description: "Disallow specified syntax via ESLint selectors" },
18
- schema: {
19
- type: "array",
20
- items: { oneOf: [{
21
- type: "string",
22
- minLength: 1
23
- }, {
24
- type: "object",
25
- additionalProperties: false,
26
- required: ["selector"],
27
- properties: {
28
- selector: {
29
- type: "string",
30
- minLength: 1
31
- },
32
- message: {
33
- type: "string",
34
- minLength: 1
35
- }
61
+ type: "suggestion",
62
+ docs: { description: "Disallow specified syntax via ESLint selectors" },
63
+ schema: {
64
+ type: "array",
65
+ items: { oneOf: [{
66
+ type: "string",
67
+ minLength: 1
68
+ }, {
69
+ type: "object",
70
+ additionalProperties: false,
71
+ required: ["selector"],
72
+ properties: {
73
+ selector: {
74
+ type: "string",
75
+ minLength: 1
76
+ },
77
+ message: {
78
+ type: "string",
79
+ minLength: 1
36
80
  }
37
- }] }
38
- },
39
- messages: { restricted: "{{message}}" }
81
+ }
82
+ }] }
40
83
  },
41
- defaultOptions: [],
42
- create(context) {
43
- const visitors = {};
44
- for (const restriction of context.options) {
45
- const selector = restrictionSelector(restriction);
46
- const message = restrictionMessage(restriction);
47
- visitors[selector] = (node) => {
48
- context.report({
49
- node,
50
- messageId: "restricted",
51
- data: { message }
52
- });
53
- };
84
+ messages: { restricted: "{{message}}" }
85
+ },
86
+ createOnce(context) {
87
+ let restrictions = [];
88
+ return {
89
+ before() {
90
+ restrictions = Array.isArray(context.options) ? [...context.options] : [];
91
+ return restrictions.length > 0;
92
+ },
93
+ Program(program) {
94
+ walk(program, (node) => {
95
+ for (const restriction of restrictions) {
96
+ if (!matchSelector(node, restrictionSelector(restriction))) continue;
97
+ context.report({
98
+ node,
99
+ messageId: "restricted",
100
+ data: { message: restrictionMessage(restriction) }
101
+ });
102
+ }
103
+ });
54
104
  }
55
- return visitors;
56
- }
57
- } }
58
- };
105
+ };
106
+ }
107
+ });
108
+ var restricted_syntax_default = definePlugin({
109
+ meta: { name: "eslint-plugin-mahir-restricted-syntax" },
110
+ rules: { "no-restricted-syntax": noRestrictedSyntax }
111
+ });
59
112
 
60
113
  //#endregion
61
- export { plugin as default };
114
+ export { restricted_syntax_default as default };
62
115
  //# sourceMappingURL=restricted-syntax.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"restricted-syntax.js","names":[],"sources":["../../src/plugins/restricted-syntax.ts"],"sourcesContent":["import type { TSESLint, TSESTree } from '@typescript-eslint/utils';\n\ntype Restriction =\n\t| string\n\t| {\n\t\t\tmessage?: string;\n\t\t\tselector: string;\n\t };\n\ntype Options = Restriction[];\n\nfunction restrictionSelector(restriction: Restriction) {\n\treturn typeof restriction === 'string' ? restriction : restriction.selector;\n}\n\nfunction restrictionMessage(restriction: Restriction) {\n\tif (typeof restriction === 'string') return `Using '${restriction}' is not allowed.`;\n\treturn restriction.message ?? `Using '${restriction.selector}' is not allowed.`;\n}\n\nconst noRestrictedSyntax: TSESLint.RuleModule<'restricted', Options> = {\n\tmeta: {\n\t\ttype: 'suggestion',\n\t\tdocs: {\n\t\t\tdescription: 'Disallow specified syntax via ESLint selectors',\n\t\t},\n\t\tschema: {\n\t\t\ttype: 'array',\n\t\t\titems: {\n\t\t\t\toneOf: [\n\t\t\t\t\t{ type: 'string', minLength: 1 },\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'object',\n\t\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t\t\trequired: ['selector'],\n\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\tselector: { type: 'string', minLength: 1 },\n\t\t\t\t\t\t\tmessage: { type: 'string', minLength: 1 },\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tmessages: {\n\t\t\trestricted: '{{message}}',\n\t\t},\n\t},\n\tdefaultOptions: [],\n\tcreate(context) {\n\t\tconst visitors: TSESLint.RuleListener = {};\n\t\tfor (const restriction of context.options) {\n\t\t\tconst selector = restrictionSelector(restriction);\n\t\t\tconst message = restrictionMessage(restriction);\n\t\t\tvisitors[selector] = (node: TSESTree.Node) => {\n\t\t\t\tcontext.report({\n\t\t\t\t\tnode,\n\t\t\t\t\tmessageId: 'restricted',\n\t\t\t\t\tdata: { message },\n\t\t\t\t});\n\t\t\t};\n\t\t}\n\t\treturn visitors;\n\t},\n};\n\nconst plugin: TSESLint.FlatConfig.Plugin = {\n\tmeta: {\n\t\tname: 'eslint-plugin-mahir-restricted-syntax',\n\t\tversion: '1.0.0',\n\t},\n\trules: {\n\t\t'no-restricted-syntax': noRestrictedSyntax,\n\t},\n};\n\nexport default plugin;\n"],"mappings":";AAWA,SAAS,oBAAoB,aAA0B;CACtD,OAAO,OAAO,gBAAgB,WAAW,cAAc,YAAY;AACpE;AAEA,SAAS,mBAAmB,aAA0B;CACrD,IAAI,OAAO,gBAAgB,UAAU,OAAO,UAAU,YAAY;CAClE,OAAO,YAAY,WAAW,UAAU,YAAY,SAAS;AAC9D;AA+CA,MAAM,SAAqC;CAC1C,MAAM;EACL,MAAM;EACN,SAAS;CACV;CACA,OAAO,EACN,wBAAwB;EAlDzB,MAAM;GACL,MAAM;GACN,MAAM,EACL,aAAa,iDACd;GACA,QAAQ;IACP,MAAM;IACN,OAAO,EACN,OAAO,CACN;KAAE,MAAM;KAAU,WAAW;IAAE,GAC/B;KACC,MAAM;KACN,sBAAsB;KACtB,UAAU,CAAC,UAAU;KACrB,YAAY;MACX,UAAU;OAAE,MAAM;OAAU,WAAW;MAAE;MACzC,SAAS;OAAE,MAAM;OAAU,WAAW;MAAE;KACzC;IACD,CACD,EACD;GACD;GACA,UAAU,EACT,YAAY,cACb;EACD;EACA,gBAAgB,CAAC;EACjB,OAAO,SAAS;GACf,MAAM,WAAkC,CAAC;GACzC,KAAK,MAAM,eAAe,QAAQ,SAAS;IAC1C,MAAM,WAAW,oBAAoB,WAAW;IAChD,MAAM,UAAU,mBAAmB,WAAW;IAC9C,SAAS,aAAa,SAAwB;KAC7C,QAAQ,OAAO;MACd;MACA,WAAW;MACX,MAAM,EAAE,QAAQ;KACjB,CAAC;IACF;GACD;GACA,OAAO;EACR;CAS0C,EAC1C;AACD"}
1
+ {"version":3,"file":"restricted-syntax.js","names":[],"sources":["../../src/plugins/restricted-syntax.ts"],"sourcesContent":["import { definePlugin, defineRule } from '@oxlint/plugins';\n\nimport type { ESTree } from '@oxlint/plugins';\n\ntype Restriction =\n\t| string\n\t| {\n\t\t\tmessage?: string;\n\t\t\tselector: string;\n\t };\n\nfunction restrictionSelector(restriction: Restriction) {\n\treturn typeof restriction === 'string' ? restriction : restriction.selector;\n}\n\nfunction restrictionMessage(restriction: Restriction) {\n\tif (typeof restriction === 'string') return `Using '${restriction}' is not allowed.`;\n\treturn restriction.message ?? `Using '${restriction.selector}' is not allowed.`;\n}\n\nfunction isAstNode(value: unknown): value is ESTree.Node {\n\treturn typeof value === 'object' && value !== null && 'type' in value && typeof (value as { type: unknown }).type === 'string';\n}\n\nfunction pathValue(node: ESTree.Node, path: string) {\n\tlet current: unknown = node;\n\tfor (const part of path.split('.')) {\n\t\tif (current == null || typeof current !== 'object') return undefined;\n\t\tcurrent = (current as Record<string, unknown>)[part];\n\t}\n\treturn current;\n}\n\nfunction matchAttributes(node: ESTree.Node, attributes: string) {\n\tfor (const attribute of attributes.matchAll(/\\[([^\\]]+)\\]/g)) {\n\t\tconst expression = attribute[1];\n\t\tconst equal = /^(.+?)=(?:'([^']*)'|\"([^\"]*)\")$/.exec(expression);\n\t\tif (!equal) return false;\n\t\tif (String(pathValue(node, equal[1].trim())) !== (equal[2] ?? equal[3])) return false;\n\t}\n\treturn true;\n}\n\nfunction matchSimple(node: ESTree.Node, simple: string) {\n\tconst type = /^(?<type>[A-Za-z]+)/.exec(simple)?.groups?.type;\n\tif (!type || node.type !== type) return false;\n\tconst not = /:not\\((?<inner>[^)]*)\\)/.exec(simple);\n\tif (not?.groups?.inner && matchAttributes(node, not.groups.inner)) return false;\n\treturn matchAttributes(node, simple.replace(/:not\\([^)]*\\)/g, ''));\n}\n\nfunction matchSelector(node: ESTree.Node, selector: string) {\n\tconst parts = selector.split(/\\s*>\\s*/);\n\tlet current: ESTree.Node | null | undefined = node;\n\tfor (let index = parts.length - 1; index >= 0; index--) {\n\t\tif (!current || !matchSimple(current, parts[index] ?? '')) return false;\n\t\tcurrent = index > 0 ? current.parent : current;\n\t}\n\treturn true;\n}\n\nfunction walk(node: ESTree.Node, visit: (current: ESTree.Node) => void, seen = new Set<ESTree.Node>()) {\n\tif (seen.has(node)) return;\n\tseen.add(node);\n\tvisit(node);\n\tfor (const key of Object.keys(node)) {\n\t\tif (key === 'parent' || key === 'loc' || key === 'range') continue;\n\t\tconst child = (node as unknown as Record<string, unknown>)[key];\n\t\tif (Array.isArray(child)) {\n\t\t\tfor (const item of child) if (isAstNode(item)) walk(item, visit, seen);\n\t\t} else if (isAstNode(child)) walk(child, visit, seen);\n\t}\n}\n\nconst noRestrictedSyntax = defineRule({\n\tmeta: {\n\t\ttype: 'suggestion',\n\t\tdocs: {\n\t\t\tdescription: 'Disallow specified syntax via ESLint selectors',\n\t\t},\n\t\tschema: {\n\t\t\ttype: 'array',\n\t\t\titems: {\n\t\t\t\toneOf: [\n\t\t\t\t\t{ type: 'string', minLength: 1 },\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'object',\n\t\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t\t\trequired: ['selector'],\n\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\tselector: { type: 'string', minLength: 1 },\n\t\t\t\t\t\t\tmessage: { type: 'string', minLength: 1 },\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\tmessages: {\n\t\t\trestricted: '{{message}}',\n\t\t},\n\t},\n\tcreateOnce(context) {\n\t\tlet restrictions: Restriction[] = [];\n\t\treturn {\n\t\t\tbefore() {\n\t\t\t\trestrictions = Array.isArray(context.options) ? [...(context.options as Restriction[])] : [];\n\t\t\t\treturn restrictions.length > 0;\n\t\t\t},\n\t\t\tProgram(program) {\n\t\t\t\twalk(program, (node) => {\n\t\t\t\t\tfor (const restriction of restrictions) {\n\t\t\t\t\t\tif (!matchSelector(node, restrictionSelector(restriction))) continue;\n\t\t\t\t\t\tcontext.report({\n\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\tmessageId: 'restricted',\n\t\t\t\t\t\t\tdata: { message: restrictionMessage(restriction) },\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t};\n\t},\n});\n\nexport default definePlugin({\n\tmeta: {\n\t\tname: 'eslint-plugin-mahir-restricted-syntax',\n\t},\n\trules: {\n\t\t'no-restricted-syntax': noRestrictedSyntax,\n\t},\n});\n"],"mappings":"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"}
@@ -3,15 +3,14 @@ declare const config: {
3
3
  plugins: ("eslint" | "react" | "unicorn" | "typescript" | "oxc" | "import" | "jsdoc" | "jest" | "vitest" | "jsx-a11y" | "nextjs" | "react-perf" | "promise" | "node" | "vue")[];
4
4
  jsPlugins: import("oxlint").ExternalPluginEntry[];
5
5
  settings: {
6
- 'better-tailwindcss': {
6
+ tailwindcss: {
7
7
  entryPoint: string;
8
8
  };
9
9
  };
10
10
  rules: {
11
- 'better-tailwindcss-js/enforce-consistent-class-order': "warn";
12
- 'better-tailwindcss-js/no-unnecessary-whitespace': "warn";
13
- 'better-tailwindcss-js/enforce-canonical-classes': "warn";
14
- 'better-tailwindcss-js/no-unknown-classes': "error";
11
+ 'tailwindcss/enforce-sort-order': "warn";
12
+ 'tailwindcss/no-unnecessary-whitespace': "warn";
13
+ 'tailwindcss/enforce-canonical': "warn";
15
14
  };
16
15
  };
17
16
  //#endregion
package/dist/tailwind.js CHANGED
@@ -4,13 +4,12 @@ import { defineConfig } from "oxlint";
4
4
  //#region src/tailwind.ts
5
5
  const config = defineConfig({
6
6
  plugins: nativePlugins,
7
- jsPlugins: [packagePlugin("better-tailwindcss-js", "eslint-plugin-better-tailwindcss")],
8
- settings: { "better-tailwindcss": { entryPoint: "app/globals.css" } },
7
+ jsPlugins: [packagePlugin("tailwindcss", "oxlint-tailwindcss")],
8
+ settings: { tailwindcss: { entryPoint: "app/globals.css" } },
9
9
  rules: {
10
- "better-tailwindcss-js/enforce-consistent-class-order": "warn",
11
- "better-tailwindcss-js/no-unnecessary-whitespace": "warn",
12
- "better-tailwindcss-js/enforce-canonical-classes": "warn",
13
- "better-tailwindcss-js/no-unknown-classes": "error"
10
+ "tailwindcss/enforce-sort-order": "warn",
11
+ "tailwindcss/no-unnecessary-whitespace": "warn",
12
+ "tailwindcss/enforce-canonical": "warn"
14
13
  }
15
14
  });
16
15
 
@@ -1 +1 @@
1
- {"version":3,"file":"tailwind.js","names":[],"sources":["../src/tailwind.ts"],"sourcesContent":["import { defineConfig } from 'oxlint';\n\nimport { nativePlugins, packagePlugin } from './config.js';\n\nconst config = defineConfig({\n\tplugins: nativePlugins,\n\tjsPlugins: [packagePlugin('better-tailwindcss-js', 'eslint-plugin-better-tailwindcss')],\n\tsettings: {\n\t\t'better-tailwindcss': {\n\t\t\tentryPoint: 'app/globals.css',\n\t\t},\n\t},\n\trules: {\n\t\t'better-tailwindcss-js/enforce-consistent-class-order': 'warn',\n\t\t'better-tailwindcss-js/no-unnecessary-whitespace': 'warn',\n\t\t'better-tailwindcss-js/enforce-canonical-classes': 'warn',\n\t\t'better-tailwindcss-js/no-unknown-classes': 'error',\n\t},\n});\n\nexport default config;\n"],"mappings":";;;;AAIA,MAAM,SAAS,aAAa;CAC3B,SAAS;CACT,WAAW,CAAC,cAAc,yBAAyB,kCAAkC,CAAC;CACtF,UAAU,EACT,sBAAsB,EACrB,YAAY,kBACb,EACD;CACA,OAAO;EACN,wDAAwD;EACxD,mDAAmD;EACnD,mDAAmD;EACnD,4CAA4C;CAC7C;AACD,CAAC"}
1
+ {"version":3,"file":"tailwind.js","names":[],"sources":["../src/tailwind.ts"],"sourcesContent":["import { defineConfig } from 'oxlint';\n\nimport { nativePlugins, packagePlugin } from './config.js';\n\nconst config = defineConfig({\n\tplugins: nativePlugins,\n\tjsPlugins: [packagePlugin('tailwindcss', 'oxlint-tailwindcss')],\n\tsettings: {\n\t\ttailwindcss: {\n\t\t\tentryPoint: 'app/globals.css',\n\t\t},\n\t},\n\trules: {\n\t\t'tailwindcss/enforce-sort-order': 'warn',\n\t\t'tailwindcss/no-unnecessary-whitespace': 'warn',\n\t\t'tailwindcss/enforce-canonical': 'warn',\n\t},\n});\n\nexport default config;\n"],"mappings":";;;;AAIA,MAAM,SAAS,aAAa;CAC3B,SAAS;CACT,WAAW,CAAC,cAAc,eAAe,oBAAoB,CAAC;CAC9D,UAAU,EACT,aAAa,EACZ,YAAY,kBACb,EACD;CACA,OAAO;EACN,kCAAkC;EAClC,yCAAyC;EACzC,iCAAiC;CAClC;AACD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imranbarbhuiya/oxc-config",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "Shared Oxlint and Oxfmt configs for JavaScript and TypeScript projects",
5
5
  "keywords": [
6
6
  "config",
@@ -30,6 +30,64 @@
30
30
  "dist"
31
31
  ],
32
32
  "type": "module",
33
+ "typesVersions": {
34
+ "*": {
35
+ "api-error": [
36
+ "./dist/api-error.d.ts"
37
+ ],
38
+ "central-icons": [
39
+ "./dist/central-icons.d.ts"
40
+ ],
41
+ "common": [
42
+ "./dist/common.d.ts"
43
+ ],
44
+ "edge": [
45
+ "./dist/edge.d.ts"
46
+ ],
47
+ "i18n": [
48
+ "./dist/i18n.d.ts"
49
+ ],
50
+ "jsdoc": [
51
+ "./dist/jsdoc.d.ts"
52
+ ],
53
+ "jsx": [
54
+ "./dist/jsx.d.ts"
55
+ ],
56
+ "module": [
57
+ "./dist/module.d.ts"
58
+ ],
59
+ "native": [
60
+ "./dist/native.d.ts"
61
+ ],
62
+ "native-tailwind": [
63
+ "./dist/native-tailwind.d.ts"
64
+ ],
65
+ "nest": [
66
+ "./dist/nest.d.ts"
67
+ ],
68
+ "next": [
69
+ "./dist/next.d.ts"
70
+ ],
71
+ "node": [
72
+ "./dist/node.d.ts"
73
+ ],
74
+ "react": [
75
+ "./dist/react.d.ts"
76
+ ],
77
+ "tsdoc": [
78
+ "./dist/tsdoc.d.ts"
79
+ ],
80
+ "typescript": [
81
+ "./dist/typescript.d.ts"
82
+ ],
83
+ "tailwind": [
84
+ "./dist/tailwind.d.ts"
85
+ ],
86
+ "oxfmt": [
87
+ "./dist/oxfmt.d.ts"
88
+ ]
89
+ }
90
+ },
33
91
  "exports": {
34
92
  "./api-error": {
35
93
  "types": "./dist/api-error.d.ts",
@@ -122,64 +180,6 @@
122
180
  "default": "./dist/oxfmt.js"
123
181
  }
124
182
  },
125
- "typesVersions": {
126
- "*": {
127
- "api-error": [
128
- "./dist/api-error.d.ts"
129
- ],
130
- "central-icons": [
131
- "./dist/central-icons.d.ts"
132
- ],
133
- "common": [
134
- "./dist/common.d.ts"
135
- ],
136
- "edge": [
137
- "./dist/edge.d.ts"
138
- ],
139
- "i18n": [
140
- "./dist/i18n.d.ts"
141
- ],
142
- "jsdoc": [
143
- "./dist/jsdoc.d.ts"
144
- ],
145
- "jsx": [
146
- "./dist/jsx.d.ts"
147
- ],
148
- "module": [
149
- "./dist/module.d.ts"
150
- ],
151
- "native": [
152
- "./dist/native.d.ts"
153
- ],
154
- "native-tailwind": [
155
- "./dist/native-tailwind.d.ts"
156
- ],
157
- "nest": [
158
- "./dist/nest.d.ts"
159
- ],
160
- "next": [
161
- "./dist/next.d.ts"
162
- ],
163
- "node": [
164
- "./dist/node.d.ts"
165
- ],
166
- "react": [
167
- "./dist/react.d.ts"
168
- ],
169
- "tsdoc": [
170
- "./dist/tsdoc.d.ts"
171
- ],
172
- "typescript": [
173
- "./dist/typescript.d.ts"
174
- ],
175
- "tailwind": [
176
- "./dist/tailwind.d.ts"
177
- ],
178
- "oxfmt": [
179
- "./dist/oxfmt.d.ts"
180
- ]
181
- }
182
- },
183
183
  "publishConfig": {
184
184
  "access": "public"
185
185
  },
@@ -194,23 +194,24 @@
194
194
  },
195
195
  "dependencies": {
196
196
  "@clack/prompts": "^1.7.0",
197
- "eslint-plugin-better-tailwindcss": "^4.6.1",
198
- "eslint-plugin-import-x": "^4.17.1",
199
- "eslint-plugin-jsdoc": "^63.0.12",
200
- "eslint-plugin-n": "^18.2.1",
197
+ "@oxlint/plugins": "1.80.0",
198
+ "eslint": "^10.9.1",
199
+ "eslint-plugin-jsdoc": "^64.2.1",
200
+ "eslint-plugin-n": "^18.3.0",
201
201
  "eslint-plugin-react": "^7.37.5",
202
- "eslint-plugin-sonarjs": "^4.1.0",
202
+ "eslint-plugin-sonarjs": "^4.2.0",
203
203
  "eslint-plugin-tsdoc": "^0.5.2",
204
- "nypm": "^0.6.8"
204
+ "nypm": "^0.6.9",
205
+ "oxlint-tailwindcss": "^1.10.2"
205
206
  },
206
207
  "devDependencies": {
207
208
  "@types/bun": "^1.4.0",
208
209
  "@types/node": "^25.9.5",
209
- "@typescript-eslint/utils": "^8.63.0",
210
+ "@typescript-eslint/utils": "^8.68.0",
210
211
  "oxfmt": "^0.65.0",
211
212
  "oxlint": "^1.80.0",
212
213
  "oxlint-tsgolint": "^7.0.2001",
213
- "tsdown": "^0.22.4",
214
+ "tsdown": "^0.22.14",
214
215
  "typescript": "6.0.3"
215
216
  },
216
217
  "peerDependencies": {
@@ -231,6 +232,6 @@
231
232
  "zod-validation-error": "^4"
232
233
  },
233
234
  "engines": {
234
- "node": ">=22.18.0"
235
+ "node": ">=22.22.2"
235
236
  }
236
237
  }