Skip to content

Commit

Permalink
Move to ESLint flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Mar 17, 2024
1 parent f060b06 commit 25354bd
Show file tree
Hide file tree
Showing 4 changed files with 202 additions and 109 deletions.
1 change: 1 addition & 0 deletions .npmignore
Expand Up @@ -3,3 +3,4 @@ test/

docs/
tsconfig.json
eslint.config.mjs
32 changes: 32 additions & 0 deletions eslint.config.mjs
@@ -0,0 +1,32 @@
import loguxTsConfig from '@logux/eslint-config/ts'

/** @type {import('eslint').Linter.FlatConfig[]} */
export default [
{ ignores: ['docs/api/assets/', '**/errors.ts'] },
...loguxTsConfig,
{
rules: {
'@typescript-eslint/consistent-type-imports': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'consistent-return': 'off',
'global-require': 'off',
'node-import/prefer-node-protocol': 'off'
}
},
{
files: ['**/*.d.ts'],
rules: {
'@typescript-eslint/no-redeclare': 'off'
}
},
{
files: ['**/*.test.*', '**/types.ts'],
rules: {
'@typescript-eslint/no-unused-expressions': 'off',
'func-style': 'off',
'n/no-unsupported-features/es-syntax': 'off',
'no-console': 'off',
'no-unused-expressions': 'off'
}
}
]
45 changes: 1 addition & 44 deletions package.json
Expand Up @@ -89,22 +89,14 @@
"source-map-js": "^1.0.2"
},
"devDependencies": {
"@logux/eslint-config": "^52.0.2",
"@logux/eslint-config": "^53.0.0",
"@size-limit/preset-small-lib": "^11.1.1",
"@types/node": "^20.11.28",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"c8": "^9.1.0",
"check-dts": "^0.7.2",
"clean-publish": "^4.3.0",
"concat-with-sourcemaps": "^1.1.0",
"eslint": "^8.57.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-perfectionist": "^2.7.0",
"eslint-plugin-prefer-let": "^3.0.1",
"eslint-plugin-promise": "^6.1.1",
"nanodelay": "^1.0.8",
"nanospy": "^1.0.0",
"postcss-parser-tests": "^8.8.0",
Expand Down Expand Up @@ -148,41 +140,6 @@
"limit": "15 KB"
}
],
"eslintConfig": {
"extends": "@logux/eslint-config/ts",
"rules": {
"@typescript-eslint/consistent-type-imports": "off",
"@typescript-eslint/no-explicit-any": "off",
"node-import/prefer-node-protocol": "off",
"consistent-return": "off",
"global-require": "off"
},
"overrides": [
{
"files": [
"*.d.ts"
],
"rules": {
"@typescript-eslint/no-redeclare": "off"
}
},
{
"files": [
"*.test.*"
],
"rules": {
"@typescript-eslint/no-unused-expressions": "off",
"no-unused-expressions": "off",
"no-console": "off",
"func-style": "off"
}
}
]
},
"eslintIgnore": [
"docs/api/assets/",
"errors.ts"
],
"clean-publish": {
"cleanDocs": true
}
Expand Down

0 comments on commit 25354bd

Please sign in to comment.