@resolid/config 4.0.0 → 5.0.0

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.
@@ -0,0 +1,3 @@
1
+ declare const config: import("oxlint").OxlintConfig;
2
+
3
+ export default config;
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from "oxlint";
2
+
3
+ export default defineConfig({
4
+ env: {
5
+ browser: true,
6
+ },
7
+ });
@@ -0,0 +1,3 @@
1
+ declare const config: import("oxlint").OxlintConfig;
2
+
3
+ export default config;
@@ -0,0 +1,23 @@
1
+ import { defineConfig } from "oxlint";
2
+
3
+ export default defineConfig({
4
+ categories: {
5
+ correctness: "warn",
6
+ },
7
+ env: {
8
+ builtin: true,
9
+ es2022: true,
10
+ },
11
+ plugins: ["eslint", "import"],
12
+ ignorePatterns: [
13
+ "**/build",
14
+ "**/coverage",
15
+ "**/dist",
16
+ "**/.netlify",
17
+ "**/.react-router",
18
+ "**/.resolid",
19
+ "**/.turbo",
20
+ "**/.vercel",
21
+ "**/.vite-inspect",
22
+ ],
23
+ });
@@ -0,0 +1,3 @@
1
+ declare const config: import("oxlint").OxlintConfig;
2
+
3
+ export default config;
package/oxlint/node.js ADDED
@@ -0,0 +1,14 @@
1
+ import { defineConfig } from "oxlint";
2
+
3
+ export default defineConfig({
4
+ env: {
5
+ node: true,
6
+ },
7
+ plugins: ["node"],
8
+ rules: {
9
+ "node/no-exports-assign": "error",
10
+ "node/no-new-require": "error",
11
+ "node/no-path-concat": "error",
12
+ "node/no-process-env": "error",
13
+ },
14
+ });
@@ -0,0 +1,3 @@
1
+ declare const config: import("oxlint").OxlintConfig;
2
+
3
+ export default config;
@@ -0,0 +1,73 @@
1
+ import { defineConfig } from "oxlint";
2
+
3
+ export default defineConfig({
4
+ plugins: ["react", "react-perf", "jsx-a11y"],
5
+ jsPlugins: [
6
+ {
7
+ name: "react-hooks-js",
8
+ specifier: "eslint-plugin-react-hooks",
9
+ },
10
+ {
11
+ name: "react-you-might-not-need-an-effect-js",
12
+ specifier: "eslint-plugin-react-you-might-not-need-an-effect",
13
+ },
14
+ ],
15
+ rules: {
16
+ "react/exhaustive-deps": ["warn", { additionalHooks: "useIsomorphicEffect" }],
17
+ "react/only-export-components": [
18
+ "warn",
19
+ {
20
+ allowConstantExport: true,
21
+ allowExportNames: [
22
+ "meta",
23
+ "links",
24
+ "action",
25
+ "handle",
26
+ "headers",
27
+ "clientAction",
28
+ "loader",
29
+ "clientLoader",
30
+ "middleware",
31
+ "clientMiddleware",
32
+ "shouldRevalidate",
33
+ "ErrorBoundary",
34
+ "HydrateFallback",
35
+ "Layout",
36
+ ],
37
+ },
38
+ ],
39
+
40
+ // Recommended rules (from LintRulePreset.Recommended)
41
+ "react-hooks-js/component-hook-factories": "error",
42
+ "react-hooks-js/config": "error",
43
+ "react-hooks-js/error-boundaries": "error",
44
+ "react-hooks-js/gating": "error",
45
+ "react-hooks-js/globals": "error",
46
+ "react-hooks-js/immutability": "error",
47
+ "react-hooks-js/incompatible-library": "error",
48
+ "react-hooks-js/preserve-manual-memoization": "error",
49
+ "react-hooks-js/purity": "error",
50
+ "react-hooks-js/refs": "error",
51
+ "react-hooks-js/set-state-in-effect": "error",
52
+ "react-hooks-js/set-state-in-render": "error",
53
+ "react-hooks-js/static-components": "error",
54
+ "react-hooks-js/unsupported-syntax": "error",
55
+ "react-hooks-js/use-memo": "error",
56
+
57
+ // Recommended-latest rules (from LintRulePreset.RecommendedLatest)
58
+ "react-hooks-js/void-use-memo": "error",
59
+
60
+ // Off rules (LintRulePreset.Off) - not enabled by default
61
+ "react-hooks-js/automatic-effect-dependencies": "off",
62
+ "react-hooks-js/capitalized-calls": "off",
63
+ "react-hooks-js/fbt": "off",
64
+ "react-hooks-js/fire": "off",
65
+ "react-hooks-js/hooks": "off",
66
+ "react-hooks-js/invariant": "off",
67
+ "react-hooks-js/memoized-effect-dependencies": "off",
68
+ "react-hooks-js/no-deriving-state-in-effects": "off",
69
+ "react-hooks-js/rule-suppression": "off",
70
+ "react-hooks-js/syntax": "off",
71
+ "react-hooks-js/todo": "off",
72
+ },
73
+ });
@@ -0,0 +1,3 @@
1
+ declare const config: import("oxlint").OxlintConfig;
2
+
3
+ export default config;
@@ -0,0 +1,13 @@
1
+ import { defineConfig } from "oxlint";
2
+ import javascriptConfig from "./javascript.js";
3
+
4
+ export default defineConfig({
5
+ plugins: ["typescript"],
6
+ rules: {
7
+ "typescript/no-import-type-side-effects": "error",
8
+ "typescript/prefer-function-type": "error",
9
+ "typescript/prefer-for-of": "error",
10
+ "typescript/consistent-type-imports": "error",
11
+ },
12
+ extends: [javascriptConfig],
13
+ });
package/package.json CHANGED
@@ -1,57 +1,51 @@
1
1
  {
2
2
  "name": "@resolid/config",
3
- "version": "4.0.0",
4
- "description": "Eslint and Prettier config",
3
+ "version": "5.0.0",
4
+ "description": "Oxlint and Typescript config",
5
5
  "keywords": [
6
+ "oxfmt",
7
+ "oxlint",
6
8
  "resolid",
7
- "eslint",
8
- "prettier",
9
9
  "typescript"
10
10
  ],
11
11
  "homepage": "https://www.resolid.tech",
12
+ "license": "MIT",
13
+ "author": "Huijie Wei",
12
14
  "repository": {
13
15
  "type": "git",
14
16
  "url": "git+https://github.com/huijiewei/resolid-config.git"
15
17
  },
16
- "license": "MIT",
17
- "author": "Huijie Wei",
18
- "sideEffects": false,
19
- "type": "module",
20
- "exports": {
21
- "./*": {
22
- "types": "./src/*.d.ts",
23
- "import": "./src/*.js"
24
- }
25
- },
26
18
  "files": [
27
- "src",
19
+ "oxlint",
28
20
  "tsconfig"
29
21
  ],
30
- "dependencies": {
31
- "@eslint/js": "^9.39.2",
32
- "eslint-plugin-erasable-syntax-only": "^0.4.0",
33
- "eslint-plugin-jsx-a11y": "^6.10.2",
34
- "eslint-plugin-n": "^17.23.2",
35
- "eslint-plugin-react": "^7.37.5",
36
- "eslint-plugin-react-hooks": "^7.0.1",
37
- "eslint-plugin-react-refresh": "^0.4.26",
38
- "globals": "^16.5.0",
39
- "prettier-plugin-organize-imports": "^4.3.0",
40
- "typescript-eslint": "^8.53.1"
22
+ "type": "module",
23
+ "sideEffects": false,
24
+ "exports": {
25
+ "./oxlint/*": {
26
+ "types": "./oxlint/*.d.ts",
27
+ "import": "./oxlint/*.js"
28
+ },
29
+ "./tsconfig/*.json": "./tsconfig/*.json"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public",
33
+ "provenance": true
41
34
  },
42
35
  "devDependencies": {
43
36
  "@changesets/cli": "^2.29.8",
44
- "@commitlint/cli": "^20.3.1",
45
- "@commitlint/config-conventional": "^20.3.1",
37
+ "@commitlint/cli": "^20.4.2",
38
+ "@commitlint/config-conventional": "^20.4.2",
46
39
  "@svitejs/changesets-changelog-github-compact": "^1.2.0",
47
- "eslint": "^9.39.2",
48
- "lefthook": "^2.0.15",
49
- "prettier": "^3.8.1",
40
+ "lefthook": "^2.1.1",
41
+ "oxfmt": "^0.35.0",
42
+ "oxlint": "^1.50.0",
50
43
  "typescript": "^5.9.3"
51
44
  },
52
45
  "peerDependencies": {
53
- "eslint": "^9.39.1",
54
- "prettier": "^3.7.4",
46
+ "eslint-plugin-react-hooks": "^7.0.1",
47
+ "eslint-plugin-react-you-might-not-need-an-effect": "^0.9.1",
48
+ "oxlint": "^1.50.0",
55
49
  "typescript": "^5.9.3"
56
50
  },
57
51
  "peerDependenciesMeta": {
@@ -62,12 +56,8 @@
62
56
  "engines": {
63
57
  "node": "^20.19.0 || ^22.13.0 || >=24"
64
58
  },
65
- "publishConfig": {
66
- "access": "public",
67
- "provenance": true
68
- },
69
59
  "scripts": {
70
- "format": "prettier . --write",
71
- "lint": "eslint ."
60
+ "format": "oxfmt",
61
+ "lint": "oxlint"
72
62
  }
73
63
  }
@@ -1,5 +0,0 @@
1
- import type { Linter } from "eslint";
2
-
3
- declare const config: Linter.Config[];
4
-
5
- export default config;
@@ -1,15 +0,0 @@
1
- import globals from "globals";
2
-
3
- /** @type {import('eslint').Linter.Config[]} */
4
- const config = [
5
- {
6
- name: "resolid/browser",
7
- languageOptions: {
8
- globals: {
9
- ...globals.browser,
10
- },
11
- },
12
- },
13
- ];
14
-
15
- export default config;
@@ -1,5 +0,0 @@
1
- import type { Linter } from "eslint";
2
-
3
- declare const config: Linter.Config[];
4
-
5
- export default config;
@@ -1,59 +0,0 @@
1
- import js from "@eslint/js";
2
- import globals from "globals";
3
-
4
- /** @type {import('eslint').Linter.Config[]} */
5
- const config = [
6
- {
7
- name: "resolid/ignores",
8
- ignores: [
9
- "**/node_modules",
10
- "**/package-lock.json",
11
- "**/yarn.lock",
12
- "**/pnpm-lock.yaml",
13
- "**/bun.lockb",
14
-
15
- "**/build",
16
- "**/coverage",
17
- "**/dist",
18
-
19
- "**/.cache",
20
- "**/.changeset",
21
- "**/.history",
22
- "**/.idea",
23
- "**/.netlify",
24
- "**/.output",
25
- "**/.react-router",
26
- "**/.resolid",
27
- "**/.turbo",
28
- "**/.vercel",
29
- "**/.yarn",
30
-
31
- "**/.vite-inspect",
32
- "**/*.min.*",
33
- "**/CHANGELOG*.md",
34
- "**/LICENSE*",
35
- ],
36
- },
37
- {
38
- name: "resolid/javascript",
39
- languageOptions: {
40
- ecmaVersion: 2022,
41
- sourceType: "module",
42
- parserOptions: {
43
- ecmaVersion: 2022,
44
- sourceType: "module",
45
- },
46
- globals: {
47
- ...globals.es2022,
48
- },
49
- },
50
- linterOptions: {
51
- reportUnusedDisableDirectives: true,
52
- },
53
- rules: {
54
- ...js.configs.recommended.rules,
55
- },
56
- },
57
- ];
58
-
59
- export default config;
@@ -1,5 +0,0 @@
1
- import type { Linter } from "eslint";
2
-
3
- declare const config: Linter.Config[];
4
-
5
- export default config;
@@ -1,27 +0,0 @@
1
- import n from "eslint-plugin-n";
2
- import globals from "globals";
3
-
4
- /** @type {import('eslint').Linter.Config[]} */
5
- const config = [
6
- {
7
- name: "resolid/node",
8
- plugins: { n },
9
- rules: {
10
- "n/handle-callback-err": ["error", "^(err|error)$"],
11
- "n/no-deprecated-api": "error",
12
- "n/no-exports-assign": "error",
13
- "n/no-new-require": "error",
14
- "n/no-path-concat": "error",
15
- "n/prefer-global/buffer": ["error", "never"],
16
- "n/prefer-global/process": ["error", "never"],
17
- "n/process-exit-as-throw": "error",
18
- },
19
- languageOptions: {
20
- globals: {
21
- ...globals.node,
22
- },
23
- },
24
- },
25
- ];
26
-
27
- export default config;
@@ -1,5 +0,0 @@
1
- import type { Linter } from "eslint";
2
-
3
- declare const config: Linter.Config[];
4
-
5
- export default config;
@@ -1,74 +0,0 @@
1
- import jsxA11y from "eslint-plugin-jsx-a11y";
2
- import react from "eslint-plugin-react";
3
- import reactHooks from "eslint-plugin-react-hooks";
4
- import reactRefresh from "eslint-plugin-react-refresh";
5
-
6
- /** @type {import("eslint").Linter.Config[]} */
7
- const config = [
8
- {
9
- name: "resolid/react",
10
- files: ["**/*.jsx", "**/*.tsx"],
11
- plugins: {
12
- react: react,
13
- "react-refresh": reactRefresh,
14
- },
15
- rules: {
16
- ...react.configs.recommended.rules,
17
- ...react.configs["jsx-runtime"].rules,
18
- "react/prop-types": "off",
19
- "react-refresh/only-export-components": [
20
- "warn",
21
- {
22
- allowConstantExport: true,
23
- allowExportNames: [
24
- "meta",
25
- "links",
26
- "action",
27
- "handle",
28
- "headers",
29
- "clientAction",
30
- "loader",
31
- "clientLoader",
32
- "middleware",
33
- "clientMiddleware",
34
- "shouldRevalidate",
35
- "ErrorBoundary",
36
- "HydrateFallback",
37
- "Layout",
38
- ],
39
- },
40
- ],
41
- },
42
- languageOptions: {
43
- parserOptions: {
44
- ecmaVersion: 2022,
45
- sourceType: "module",
46
- ecmaFeatures: {
47
- jsx: true,
48
- },
49
- },
50
- },
51
- settings: {
52
- react: {
53
- version: "detect",
54
- },
55
- },
56
- },
57
- {
58
- name: "resolid/react-hook",
59
- files: ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"],
60
- ...reactHooks.configs.flat["recommended-latest"],
61
- settings: {
62
- "react-hooks": {
63
- additionalEffectHooks: "useIsomorphicEffect",
64
- },
65
- },
66
- },
67
- {
68
- name: "resolid/jsx-a11y",
69
- files: ["**/*.jsx", "**/*.tsx"],
70
- ...jsxA11y.flatConfigs.recommended,
71
- },
72
- ];
73
-
74
- export default config;
@@ -1,5 +0,0 @@
1
- import type { FlatConfig } from "typescript-eslint";
2
-
3
- declare const config: FlatConfig.ConfigArray;
4
-
5
- export default config;
@@ -1,38 +0,0 @@
1
- import erasableSyntaxOnly from "eslint-plugin-erasable-syntax-only";
2
- import { defineConfig } from "eslint/config";
3
- import typescript from "typescript-eslint";
4
- import javascript from "./eslint.javascript.js";
5
-
6
- /** @type {import("eslint").Linter.Config[]} */
7
- export default defineConfig(javascript, {
8
- name: "resolid/typescript",
9
- files: ["**/*.ts", "**/*.tsx"],
10
- extends: [typescript.configs.recommended, erasableSyntaxOnly.configs.recommended],
11
- languageOptions: {
12
- parser: typescript.parser,
13
- parserOptions: {
14
- projectService: true,
15
- },
16
- },
17
- rules: {
18
- "@typescript-eslint/no-import-type-side-effects": "error",
19
- "@typescript-eslint/method-signature-style": ["error", "property"],
20
- "@typescript-eslint/prefer-function-type": "error",
21
- "@typescript-eslint/prefer-for-of": "error",
22
- "@typescript-eslint/consistent-type-imports": "error",
23
- "no-unused-vars": "off",
24
- "@typescript-eslint/no-unused-vars": [
25
- "error",
26
- {
27
- args: "after-used",
28
- argsIgnorePattern: "^_",
29
- caughtErrors: "all",
30
- caughtErrorsIgnorePattern: "^_",
31
- destructuredArrayIgnorePattern: "^_",
32
- vars: "all",
33
- varsIgnorePattern: "^_",
34
- ignoreRestSiblings: true,
35
- },
36
- ],
37
- },
38
- });
package/src/prettier.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import type { Config } from "prettier";
2
-
3
- declare const config: Config;
4
- export default config;
package/src/prettier.js DELETED
@@ -1,9 +0,0 @@
1
- import { fileURLToPath } from "node:url";
2
-
3
- /** @type {import('prettier').Config} */
4
- const config = {
5
- plugins: [fileURLToPath(import.meta.resolve("prettier-plugin-organize-imports"))],
6
- organizeImportsSkipDestructiveCodeActions: true,
7
- };
8
-
9
- export default config;