@boltz.one/eslint-config 0.1.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.
- package/README.md +3 -0
- package/base.js +42 -0
- package/next.js +57 -0
- package/package.json +40 -0
- package/react-internal.js +41 -0
package/README.md
ADDED
package/base.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import eslintConfigPrettier from "eslint-config-prettier";
|
|
3
|
+
import turboPlugin from "eslint-plugin-turbo";
|
|
4
|
+
import tseslint from "typescript-eslint";
|
|
5
|
+
import onlyWarn from "eslint-plugin-only-warn";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A shared ESLint configuration for the repository.
|
|
9
|
+
*
|
|
10
|
+
* @type {import("eslint").Linter.Config[]}
|
|
11
|
+
* */
|
|
12
|
+
export const config = [
|
|
13
|
+
js.configs.recommended,
|
|
14
|
+
eslintConfigPrettier,
|
|
15
|
+
...tseslint.configs.recommended,
|
|
16
|
+
{
|
|
17
|
+
plugins: {
|
|
18
|
+
turbo: turboPlugin,
|
|
19
|
+
},
|
|
20
|
+
rules: {
|
|
21
|
+
"turbo/no-undeclared-env-vars": "warn",
|
|
22
|
+
// Bỏ qua biến/tham số/error cố ý không dùng có tiền tố `_`.
|
|
23
|
+
"@typescript-eslint/no-unused-vars": [
|
|
24
|
+
"warn",
|
|
25
|
+
{
|
|
26
|
+
argsIgnorePattern: "^_",
|
|
27
|
+
varsIgnorePattern: "^_",
|
|
28
|
+
caughtErrorsIgnorePattern: "^_",
|
|
29
|
+
ignoreRestSiblings: true,
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
plugins: {
|
|
36
|
+
onlyWarn,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
ignores: ["dist/**"],
|
|
41
|
+
},
|
|
42
|
+
];
|
package/next.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import { globalIgnores } from "eslint/config";
|
|
3
|
+
import eslintConfigPrettier from "eslint-config-prettier";
|
|
4
|
+
import tseslint from "typescript-eslint";
|
|
5
|
+
import pluginReactHooks from "eslint-plugin-react-hooks";
|
|
6
|
+
import pluginReact from "eslint-plugin-react";
|
|
7
|
+
import globals from "globals";
|
|
8
|
+
import pluginNext from "@next/eslint-plugin-next";
|
|
9
|
+
import { config as baseConfig } from "./base.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A custom ESLint configuration for libraries that use Next.js.
|
|
13
|
+
*
|
|
14
|
+
* @type {import("eslint").Linter.Config[]}
|
|
15
|
+
* */
|
|
16
|
+
export const nextJsConfig = [
|
|
17
|
+
...baseConfig,
|
|
18
|
+
js.configs.recommended,
|
|
19
|
+
eslintConfigPrettier,
|
|
20
|
+
...tseslint.configs.recommended,
|
|
21
|
+
globalIgnores([
|
|
22
|
+
// Default ignores of eslint-config-next:
|
|
23
|
+
".next/**",
|
|
24
|
+
"out/**",
|
|
25
|
+
"build/**",
|
|
26
|
+
"next-env.d.ts",
|
|
27
|
+
]),
|
|
28
|
+
{
|
|
29
|
+
...pluginReact.configs.flat.recommended,
|
|
30
|
+
languageOptions: {
|
|
31
|
+
...pluginReact.configs.flat.recommended.languageOptions,
|
|
32
|
+
globals: {
|
|
33
|
+
...globals.serviceworker,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
plugins: {
|
|
39
|
+
"@next/next": pluginNext,
|
|
40
|
+
},
|
|
41
|
+
rules: {
|
|
42
|
+
...pluginNext.configs.recommended.rules,
|
|
43
|
+
...pluginNext.configs["core-web-vitals"].rules,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
plugins: {
|
|
48
|
+
"react-hooks": pluginReactHooks,
|
|
49
|
+
},
|
|
50
|
+
settings: { react: { version: "detect" } },
|
|
51
|
+
rules: {
|
|
52
|
+
...pluginReactHooks.configs.recommended.rules,
|
|
53
|
+
// React scope no longer necessary with new JSX transform.
|
|
54
|
+
"react/react-in-jsx-scope": "off",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
];
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@boltz.one/eslint-config",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "ESLint config dùng chung cho monorepo Boltz One: base, next-js, react-internal",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/boltz-one/core.git",
|
|
10
|
+
"directory": "packages/eslint-config"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"base.js",
|
|
14
|
+
"next.js",
|
|
15
|
+
"react-internal.js",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"exports": {
|
|
19
|
+
"./base": "./base.js",
|
|
20
|
+
"./next-js": "./next.js",
|
|
21
|
+
"./react-internal": "./react-internal.js"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public",
|
|
25
|
+
"registry": "https://registry.npmjs.org"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@eslint/js": "^9.39.1",
|
|
29
|
+
"@next/eslint-plugin-next": "^16.2.0",
|
|
30
|
+
"eslint": "^9.39.1",
|
|
31
|
+
"eslint-config-prettier": "^10.1.1",
|
|
32
|
+
"eslint-plugin-only-warn": "^1.1.0",
|
|
33
|
+
"eslint-plugin-react": "^7.37.5",
|
|
34
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
35
|
+
"eslint-plugin-turbo": "^2.7.1",
|
|
36
|
+
"globals": "^16.5.0",
|
|
37
|
+
"typescript": "^5.9.2",
|
|
38
|
+
"typescript-eslint": "^8.50.0"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import eslintConfigPrettier from "eslint-config-prettier";
|
|
3
|
+
import tseslint from "typescript-eslint";
|
|
4
|
+
import pluginReactHooks from "eslint-plugin-react-hooks";
|
|
5
|
+
import pluginReact from "eslint-plugin-react";
|
|
6
|
+
import globals from "globals";
|
|
7
|
+
import { config as baseConfig } from "./base.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A custom ESLint configuration for libraries that use React.
|
|
11
|
+
*
|
|
12
|
+
* @type {import("eslint").Linter.Config[]} */
|
|
13
|
+
export const config = [
|
|
14
|
+
...baseConfig,
|
|
15
|
+
js.configs.recommended,
|
|
16
|
+
eslintConfigPrettier,
|
|
17
|
+
...tseslint.configs.recommended,
|
|
18
|
+
pluginReact.configs.flat.recommended,
|
|
19
|
+
{
|
|
20
|
+
languageOptions: {
|
|
21
|
+
...pluginReact.configs.flat.recommended.languageOptions,
|
|
22
|
+
globals: {
|
|
23
|
+
...globals.serviceworker,
|
|
24
|
+
...globals.browser,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
plugins: {
|
|
30
|
+
"react-hooks": pluginReactHooks,
|
|
31
|
+
},
|
|
32
|
+
settings: { react: { version: "detect" } },
|
|
33
|
+
rules: {
|
|
34
|
+
...pluginReactHooks.configs.recommended.rules,
|
|
35
|
+
// React scope no longer necessary with new JSX transform.
|
|
36
|
+
"react/react-in-jsx-scope": "off",
|
|
37
|
+
// Cho phép dấu nháy/ký tự trong copy UI (apostrophe, quote) — không cần escape.
|
|
38
|
+
"react/no-unescaped-entities": "off",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
];
|