-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
48 lines (48 loc) · 1.53 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
module.exports = {
parserOptions: {
ecmaVersion: 2020, // 支援 ECMAScript2020
sourceType: 'module', // 使用 ECMAScript ****module
ecmaFeatures: {
jsx: true, // 支援 JSX
experimentalObjectRestSpread: true,
},
},
// 加上 ts 相關規則
overrides: [
{
files: ['*.ts', '*.tsx'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
},
],
extends: ['plugin:import/typescript', 'plugin:tailwindcss/recommended', 'next/core-web-vitals'],
// 加上 no console log 規則
rules: {
'no-console': 'error',
'tailwindcss/no-contradicting-classname': 'error',
'tailwindcss/classnames-order': 'off',
'tailwindcss/enforces-negative-arbitrary-values': 'error',
'tailwindcss/enforces-shorthand': 'off',
'tailwindcss/migration-from-tailwind-2': 'error',
'tailwindcss/no-arbitrary-value': 'error',
'tailwindcss/no-custom-classname': 'error',
},
// 整合 prettier 和解決 prettier 衝突問題
plugins: ['prettier'],
settings: {
tailwindcss: {
// These are the default values but feel free to customize
callees: ['classnames', 'clsx', 'ctl'],
config: 'tailwind.config.js',
cssFiles: ['**/*.css', '!**/node_modules', '!**/.*', '!**/dist', '!**/build'],
cssFilesRefreshRate: '5_000',
removeDuplicates: true,
whitelist: [],
},
},
};