Skip to content

Commit

Permalink
feat: use new eslint config format
Browse files Browse the repository at this point in the history
  • Loading branch information
0t4u committed Aug 10, 2024
1 parent e12b469 commit 9733b2a
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 22 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

54 changes: 36 additions & 18 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
// @ts-check
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import * as augu from '@augu/eslint-config';

import eslint from "@eslint/js";

export default [
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
// @ts-expect-error incorrect type from package, but still compatible
augu.javascript(),
// temp disable due to rule move from typescript-eslint (ts) -> stylistic (style)
// await augu.typescript(),
{
"parser": "@typescript-eslint/parser",
"extends": "@augu",
"rules": {
"indent": ["error", 4, { "SwitchCase": 1 }],
"quotes": ["error", "single"],
"brace-style": ["error", "1tbs"],
"array-bracket-spacing": ["error", "always"],
"block-spacing": ["error", "always"],
"arrow-spacing": "error",
"switch-colon-spacing": ["error", {"after": true, "before": false}],
"camelcase": "off",
"require-await": "error"
}
}
];
ignores: [
'docs/',
'dist/',
'node_modules/',
],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
'indent': [ 'error', 4, { 'SwitchCase': 1 } ],
'quotes': [ 'error', 'single' ],
'brace-style': [ 'error', '1tbs' ],
'object-curly-spacing': [ 'error', 'always' ],
'array-bracket-spacing': [ 'error', 'always' ],
'block-spacing': [ 'error', 'always' ],
'arrow-spacing': 'error',
'switch-colon-spacing': [ 'error', { 'after': true, 'before': false } ],
'camelcase': 'off',
'require-await': 'error',
},
},
);
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
},
"devDependencies": {
"@augu/eslint-config": "5.2.4",
"@eslint/js": "^9.9.0",
"@types/eslint__js": "^8.42.3",
"@types/node": "^22.2.0",
"@types/node-fetch": "^2.6.11",
"@types/ws": "^8.5.12",
Expand All @@ -53,6 +55,7 @@
"eslint": "^9.9.0",
"tsup": "^8.2.4",
"typedoc": "^0.26.5",
"typescript": "^5.5.4"
"typescript": "^5.5.4",
"typescript-eslint": "^8.0.1"
}
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"allowJs": true,
"module": "node16",
"moduleResolution": "node16",
"outDir": "dist",
Expand Down

0 comments on commit 9733b2a

Please sign in to comment.