Skip to content

Commit f6038b6

Browse files
committed
chore(lint): introduce eslint import plugin
1 parent 5521c51 commit f6038b6

30 files changed

+723
-117
lines changed

.eslintrc.js

+37-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
// @ts-check
22

3-
/** @type {import('eslint').Linter} */
3+
/** @type {import('eslint').Linter.Config} */
44
const eslintConfig = {
55
root: true,
66
parser: '@typescript-eslint/parser',
7-
plugins: ['@typescript-eslint', 'prettier'],
7+
plugins: ['@typescript-eslint', 'import', 'prettier'],
88
extends: [
99
'eslint:recommended',
1010
'plugin:@typescript-eslint/recommended',
11+
'plugin:import/recommended',
12+
'plugin:import/typescript',
1113
'prettier',
1214
],
1315
rules: {
@@ -19,8 +21,41 @@ const eslintConfig = {
1921
destructuredArrayIgnorePattern: '^_',
2022
},
2123
],
24+
'@typescript-eslint/consistent-type-imports': [
25+
'error',
26+
{
27+
prefer: 'type-imports',
28+
fixStyle: 'inline-type-imports',
29+
},
30+
],
31+
'import/consistent-type-specifier-style': ['error', 'prefer-inline'],
32+
'import/no-unused-modules': [
33+
'error',
34+
{
35+
unusedExports: true,
36+
},
37+
],
38+
'import/order': [
39+
'error',
40+
{
41+
alphabetize: {
42+
order: 'asc',
43+
},
44+
'newlines-between': 'always',
45+
},
46+
],
2247
'prettier/prettier': 'error',
2348
},
49+
settings: {
50+
'import/resolver': {
51+
'eslint-import-resolver-custom-alias': {
52+
alias: {
53+
'@': './src',
54+
},
55+
extensions: ['.ts', '.tsx', '.d.ts'],
56+
},
57+
},
58+
},
2459
}
2560

2661
// eslint-disable-next-line no-undef

jest/utils/compile-css.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import { resolve } from 'node:path'
2+
13
import postcss from 'postcss'
24
import tailwindcss from 'tailwindcss'
3-
import { resolve } from 'node:path'
4-
import tailwindcss3d from '../../src'
55
import { type Config } from 'tailwindcss/types/config'
66

7+
import tailwindcss3d from '../../src'
8+
79
type Theme = Config['theme']
810

911
export const compileCSS = async (

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
"concurrently": "8.0.1",
5151
"eslint": "8.40.0",
5252
"eslint-config-prettier": "8.8.0",
53+
"eslint-import-resolver-custom-alias": "1.3.0",
54+
"eslint-plugin-import": "2.27.5",
5355
"eslint-plugin-prettier": "4.2.1",
5456
"jest": "29.5.0",
5557
"markdownlint-cli": "0.34.0",

0 commit comments

Comments
 (0)