@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 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 { config as baseConfig } from './base.mjs';
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 pluginReact from 'eslint-plugin-react';
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
- // Reuse base rules
19
- ...baseConfig,
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
- importPlugin.flatConfigs.recommended, // ? https://github.com/import-js/eslint-plugin-import
44
- ...tseslint.configs.recommended, // ? https://github.com/typescript-eslint/typescript-eslint
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@korioinc/next-configs",
3
- "version": "2.0.17",
3
+ "version": "2.0.18",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./eslint": "./eslint/next.mjs",
@@ -6,7 +6,7 @@
6
6
  "module": "ESNext",
7
7
  "moduleResolution": "Bundler",
8
8
  "allowJs": true,
9
- "jsx": "preserve",
9
+ "jsx": "react-jsx",
10
10
  "noEmit": true,
11
11
  "noUncheckedIndexedAccess": false
12
12
  }