Skip to content

Commit

Permalink
Migrate Eslint configuration to flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
elchininet committed Apr 11, 2024
1 parent d643348 commit cbb8c7a
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 50 deletions.
38 changes: 0 additions & 38 deletions .eslintrc.js

This file was deleted.

43 changes: 43 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
const tseslint = require('typescript-eslint');
const js = require('@eslint/js');
const globals = require('globals');

module.exports = [
{
languageOptions: {
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
...globals.browser,
...globals.node,
...globals.es2020
}
}
},
js.configs.recommended,
...tseslint.configs.recommended,
{
rules: {
quotes: [
'error',
'single',
{
avoidEscape: true,
allowTemplateLiterals: true
}
],
indent: ['error', 4],
semi: ['error', 'always'],
'no-trailing-spaces': [2, { skipBlankLines: true }],
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/ban-ts-comment': 'off'
}
},
{
files: ['*.js'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off'
}
}
];
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,9 @@
"@types/jest-specific-snapshot": "^0.5.9",
"@types/node": "^20.12.7",
"@types/rtlcss": "^3.5.4",
"@typescript-eslint/eslint-plugin": "^7.6.0",
"@typescript-eslint/parser": "^7.6.0",
"eslint": "^9.0.0",
"eslint-plugin-jest": "^28.2.0",
"globals": "^15.0.0",
"jest": "^29.7.0",
"jest-specific-snapshot": "^8.0.0",
"postcss": "^8.4.26",
Expand All @@ -88,7 +87,8 @@
"rollup-plugin-ts": "^3.4.5",
"ts-jest": "^29.1.2",
"tslib": "^2.6.2",
"typescript": "^5.4.5"
"typescript": "^5.4.5",
"typescript-eslint": "^7.6.0"
},
"peerDependencies": {
"postcss": "^8.4.21"
Expand Down
41 changes: 32 additions & 9 deletions pnpm-lock.yaml

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

0 comments on commit cbb8c7a

Please sign in to comment.