Skip to content

Commit

Permalink
style: add eslint-plugin-simple-import-sort
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Aug 28, 2024
1 parent 128b5d7 commit 934e56d
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 8 deletions.
1 change: 1 addition & 0 deletions __tests__/index.test.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import assert from 'assert';

import parse from '../esm/index.mjs';

assert.strictEqual(typeof parse, 'function');
Expand Down
3 changes: 2 additions & 1 deletion __tests__/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import inlineStyleParser from 'inline-style-parser';
import { cases, errors, invalids } from './fixtures';

import parse from '../src';
import { cases, errors, invalids } from './fixtures';

describe('valid cases', () => {
describe.each(cases)('when style=%p', (style, expected) => {
Expand Down
17 changes: 11 additions & 6 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import prettier from 'eslint-plugin-prettier';
import globals from 'globals';
import tsParser from '@typescript-eslint/parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

import { includeIgnoreFile } from '@eslint/compat';
import { FlatCompat } from '@eslint/eslintrc';
import js from '@eslint/js';
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import prettier from 'eslint-plugin-prettier';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import globals from 'globals';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand All @@ -29,6 +31,7 @@ export default [
{
plugins: {
'@typescript-eslint': typescriptEslint,
'simple-import-sort': simpleImportSort,
prettier,
},

Expand All @@ -46,6 +49,8 @@ export default [
'no-console': 'error',
'no-debugger': 'error',
'prettier/prettier': 'error',
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
},
},
];
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"@typescript-eslint/parser": "8.3.0",
"eslint": "9.9.1",
"eslint-plugin-prettier": "5.2.1",
"eslint-plugin-simple-import-sort": "12.1.1",
"globals": "15.9.0",
"husky": "9.1.5",
"jest": "29.7.0",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import parse from 'inline-style-parser';
import type { Declaration } from 'inline-style-parser';
import parse from 'inline-style-parser';

export { Declaration };

Expand Down

0 comments on commit 934e56d

Please sign in to comment.