Skip to content

Commit 934e56d

Browse files
style: add eslint-plugin-simple-import-sort
1 parent 128b5d7 commit 934e56d

File tree

6 files changed

+34
-8
lines changed

6 files changed

+34
-8
lines changed

__tests__/index.test.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import assert from 'assert';
2+
23
import parse from '../esm/index.mjs';
34

45
assert.strictEqual(typeof parse, 'function');

__tests__/index.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import inlineStyleParser from 'inline-style-parser';
2-
import { cases, errors, invalids } from './fixtures';
2+
33
import parse from '../src';
4+
import { cases, errors, invalids } from './fixtures';
45

56
describe('valid cases', () => {
67
describe.each(cases)('when style=%p', (style, expected) => {

eslint.config.mjs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
import typescriptEslint from '@typescript-eslint/eslint-plugin';
2-
import prettier from 'eslint-plugin-prettier';
3-
import globals from 'globals';
4-
import tsParser from '@typescript-eslint/parser';
51
import path from 'node:path';
62
import { fileURLToPath } from 'node:url';
7-
import js from '@eslint/js';
8-
import { FlatCompat } from '@eslint/eslintrc';
3+
94
import { includeIgnoreFile } from '@eslint/compat';
5+
import { FlatCompat } from '@eslint/eslintrc';
6+
import js from '@eslint/js';
7+
import typescriptEslint from '@typescript-eslint/eslint-plugin';
8+
import tsParser from '@typescript-eslint/parser';
9+
import prettier from 'eslint-plugin-prettier';
10+
import simpleImportSort from 'eslint-plugin-simple-import-sort';
11+
import globals from 'globals';
1012

1113
const __filename = fileURLToPath(import.meta.url);
1214
const __dirname = path.dirname(__filename);
@@ -29,6 +31,7 @@ export default [
2931
{
3032
plugins: {
3133
'@typescript-eslint': typescriptEslint,
34+
'simple-import-sort': simpleImportSort,
3235
prettier,
3336
},
3437

@@ -46,6 +49,8 @@ export default [
4649
'no-console': 'error',
4750
'no-debugger': 'error',
4851
'prettier/prettier': 'error',
52+
'simple-import-sort/exports': 'error',
53+
'simple-import-sort/imports': 'error',
4954
},
5055
},
5156
];

package-lock.json

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"@typescript-eslint/parser": "8.3.0",
6060
"eslint": "9.9.1",
6161
"eslint-plugin-prettier": "5.2.1",
62+
"eslint-plugin-simple-import-sort": "12.1.1",
6263
"globals": "15.9.0",
6364
"husky": "9.1.5",
6465
"jest": "29.7.0",

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import parse from 'inline-style-parser';
21
import type { Declaration } from 'inline-style-parser';
2+
import parse from 'inline-style-parser';
33

44
export { Declaration };
55

0 commit comments

Comments
 (0)