@korioinc/next-configs 2.0.17 → 2.0.18
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/eslint/next.mjs +29 -17
- package/package.json +1 -1
- package/tsconfig/nextjs.json +1 -1
package/eslint/next.mjs
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import pluginJs from '@eslint/js';
|
|
2
|
-
import nextPlugin from '@next/eslint-plugin-next';
|
|
3
|
-
import typescriptEslint from '@typescript-eslint/eslint-plugin';
|
|
4
2
|
import typescriptParser from '@typescript-eslint/parser';
|
|
5
3
|
|
|
6
|
-
import
|
|
4
|
+
import nextVitals from 'eslint-config-next/core-web-vitals';
|
|
5
|
+
import nextTs from 'eslint-config-next/typescript';
|
|
7
6
|
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
8
7
|
import importPlugin from 'eslint-plugin-import';
|
|
9
8
|
import prettier from 'eslint-plugin-prettier';
|
|
10
9
|
import pluginPromise from 'eslint-plugin-promise';
|
|
11
|
-
import
|
|
10
|
+
import turboPlugin from 'eslint-plugin-turbo';
|
|
12
11
|
import valtio from 'eslint-plugin-valtio';
|
|
12
|
+
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
13
13
|
import globals from 'globals';
|
|
14
|
-
import tseslint from 'typescript-eslint';
|
|
15
14
|
|
|
16
15
|
/** @type {import('eslint').Linter.Config[]} */
|
|
17
|
-
const config = [
|
|
18
|
-
|
|
19
|
-
...
|
|
16
|
+
const config = defineConfig([
|
|
17
|
+
...nextVitals,
|
|
18
|
+
...nextTs,
|
|
20
19
|
{
|
|
21
20
|
files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'],
|
|
22
21
|
},
|
|
@@ -40,14 +39,21 @@ const config = [
|
|
|
40
39
|
},
|
|
41
40
|
},
|
|
42
41
|
pluginJs.configs.recommended, // ? https://github.com/eslint/eslint
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
{
|
|
43
|
+
rules: {
|
|
44
|
+
...importPlugin.flatConfigs.recommended.rules,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
45
47
|
pluginPromise.configs['flat/recommended'], // ? https://github.com/eslint-community/eslint-plugin-promise
|
|
46
|
-
pluginReact.configs.flat.recommended, // ? https://github.com/jsx-eslint/eslint-plugin-react
|
|
47
|
-
pluginReact.configs.flat['jsx-runtime'], // ? https://github.com/jsx-eslint/eslint-plugin-react
|
|
48
48
|
eslintConfigPrettier, // ? https://github.com/prettier/eslint-config-prettier
|
|
49
|
+
{
|
|
50
|
+
plugins: {
|
|
51
|
+
turbo: turboPlugin,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
49
54
|
{
|
|
50
55
|
rules: {
|
|
56
|
+
'turbo/no-undeclared-env-vars': 'warn',
|
|
51
57
|
'no-unused-vars': 'off',
|
|
52
58
|
'react/react-in-jsx-scope': 'off',
|
|
53
59
|
'react-hooks/exhaustive-deps': 'off',
|
|
@@ -56,9 +62,11 @@ const config = [
|
|
|
56
62
|
'newline-before-return': 'error',
|
|
57
63
|
'@typescript-eslint/no-unused-vars': 'off',
|
|
58
64
|
'@typescript-eslint/no-unused-expressions': 'off',
|
|
65
|
+
'import/default': 'off',
|
|
59
66
|
'import/no-unresolved': 'off',
|
|
60
67
|
'import/no-named-as-default': 'off',
|
|
61
68
|
'react/no-unescaped-entities': 'off',
|
|
69
|
+
'react-hooks/rules-of-hooks': 'off',
|
|
62
70
|
},
|
|
63
71
|
},
|
|
64
72
|
// valtio
|
|
@@ -76,13 +84,9 @@ const config = [
|
|
|
76
84
|
// ! ======================================================
|
|
77
85
|
{
|
|
78
86
|
plugins: {
|
|
79
|
-
'@next/next': nextPlugin,
|
|
80
87
|
prettier,
|
|
81
|
-
'@typescript-eslint': typescriptEslint,
|
|
82
88
|
},
|
|
83
89
|
rules: {
|
|
84
|
-
...nextPlugin.configs.recommended.rules,
|
|
85
|
-
...nextPlugin.configs['core-web-vitals'].rules,
|
|
86
90
|
'@next/next/no-img-element': 'off',
|
|
87
91
|
|
|
88
92
|
// Prettier
|
|
@@ -95,6 +99,14 @@ const config = [
|
|
|
95
99
|
{
|
|
96
100
|
ignores: ['.next/*', 'dist/**', 'lang/index.ts'],
|
|
97
101
|
},
|
|
98
|
-
|
|
102
|
+
// Override default ignores of eslint-config-next.
|
|
103
|
+
globalIgnores([
|
|
104
|
+
// Default ignores of eslint-config-next:
|
|
105
|
+
'.next/**',
|
|
106
|
+
'out/**',
|
|
107
|
+
'build/**',
|
|
108
|
+
'next-env.d.ts',
|
|
109
|
+
]),
|
|
110
|
+
]);
|
|
99
111
|
|
|
100
112
|
export default config;
|
package/package.json
CHANGED