Skip to content

Commit

Permalink
chore: use ESLint's flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
P0lip committed Jan 28, 2024
1 parent e77043d commit f8f914a
Show file tree
Hide file tree
Showing 7 changed files with 2,897 additions and 2,680 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

54 changes: 0 additions & 54 deletions .eslintrc

This file was deleted.

1 change: 1 addition & 0 deletions .ls-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ ignore:
- dist
- node_modules
- rollup.config.js
- eslint.config.js
- karma.conf.js
- benchmarks
47 changes: 47 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import babelParser from '@babel/eslint-parser';
import js from '@eslint/js';
import chaiExpect from 'eslint-plugin-chai-expect';
import chaiFriendly from 'eslint-plugin-chai-friendly';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import globals from 'globals';

export default [
{
files: ['**/*.mjs', '**/*.js'],
ignores: ['src/parser/parser.mjs'],
languageOptions: {
ecmaVersion: 2023,
parser: babelParser,
sourceType: 'module',
},
plugins: {
'simple-import-sort': simpleImportSort,
},
rules: {
...js.configs.recommended.rules,
'padding-line-between-statements': [
'error',
{ blankLine: 'never', prev: '*', next: 'case' },
{ blankLine: 'never', prev: '*', next: 'default' },
{ blankLine: 'always', prev: 'block-like', next: 'break' },
],
'simple-import-sort/imports': 'error',
},
},
{
files: ['src/**/__tests__/*.test.mjs'],
languageOptions: {
globals: globals.mocha,
},
plugins: {
'chai-expect': chaiExpect,
'chai-friendly': chaiFriendly,
},
rules: {
'no-unused-expressions': 0,
'sort-keys': 'off',
...chaiExpect.configs.recommended.rules,
'chai-friendly/no-unused-expressions': 2,
},
},
];
Loading

0 comments on commit f8f914a

Please sign in to comment.