Skip to content

Commit

Permalink
chore: eslint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
0t4u committed Aug 10, 2024
1 parent 9733b2a commit 0f13f27
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
30 changes: 22 additions & 8 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @ts-check
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import stylistic from '@stylistic/eslint-plugin';
import * as augu from '@augu/eslint-config';

export default tseslint.config(
Expand All @@ -23,15 +24,28 @@ export default tseslint.config(
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
'@stylistic': stylistic,
},
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 } ],
'@stylistic/semi': [ 'error' ],
'@stylistic/member-delimiter-style': [ 'error' ],
'@stylistic/indent': [ 'error', 4, { 'SwitchCase': 1 }],
'@stylistic/space-infix-ops': [ 'error' ],
'@stylistic/key-spacing': [ 'error', { 'mode': 'strict' }],
'@stylistic/keyword-spacing': [ 'error' ],
'@stylistic/indent-binary-ops': [ 'error', 4 ],
'@stylistic/type-generic-spacing': [ 'error' ],
'@stylistic/type-named-tuple-spacing': [ 'error' ],
'@stylistic/type-annotation-spacing': [ 'error', { 'before': false, 'after': true, 'overrides': { 'arrow': { 'before': true, 'after': true }}}],
'@stylistic/quotes': [ 'error', 'single' ],
'@stylistic/comma-dangle': [ 'error', 'always-multiline' ],
'@stylistic/brace-style': [ 'error', '1tbs' ],
'@stylistic/object-curly-spacing': [ 'error', 'always', { 'objectsInObjects': false, 'arraysInObjects': false }],
'@stylistic/array-bracket-spacing': [ 'error', 'always', { 'objectsInArrays': false, 'arraysInArrays': false }],
'@stylistic/block-spacing': [ 'error', 'always' ],
'@stylistic/arrow-spacing': 'error',
'@stylistic/switch-colon-spacing': [ 'error', { 'after': true, 'before': false }],
'camelcase': 'off',
'require-await': 'error',
},
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"devDependencies": {
"@augu/eslint-config": "5.2.4",
"@eslint/js": "^9.9.0",
"@stylistic/eslint-plugin": "^2.6.2",
"@types/eslint__js": "^8.42.3",
"@types/node": "^22.2.0",
"@types/node-fetch": "^2.6.11",
Expand Down

0 comments on commit 0f13f27

Please sign in to comment.