Skip to content

Commit

Permalink
[conf] allow void as statements enabling no-void and `@typescript-e…
Browse files Browse the repository at this point in the history
…slint/no-floating-promises`
  • Loading branch information
mrhyde committed Sep 3, 2024
1 parent 2901bdd commit 799dcbd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
4 changes: 3 additions & 1 deletion source/axiom.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { includeIgnoreFile } from '@eslint/compat'
import type { Linter } from 'eslint'
import { resolve } from 'node:path'
import axiomRules from './configs/axiom.ts'
import strict from './configs/strict.ts'
import stylistic from './configs/stylistic.ts'
import * as plugins from './plugins/index.ts'
Expand Down Expand Up @@ -45,6 +46,7 @@ export const axiom = (dirname: string): Linter.Config[] => {
},
strict,
...Object.values(plugins),
stylistic
stylistic,
axiomRules
].flat()
}
2 changes: 1 addition & 1 deletion source/axiom.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('axiom', () => {
const result = axiom(dirname)

expect(result).toBeInstanceOf(Array)
expect(result).toHaveLength(27)
expect(result).toHaveLength(28)

expect(result[0]).toEqual({
name: 'axiom/setup/ignore-files',
Expand Down
15 changes: 15 additions & 0 deletions source/configs/axiom.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Linter } from 'eslint'

const axiom: Linter.Config[] = [
{
name: 'axiom/rules/all',
rules: {
// see: https://github.com/standard/standard/issues/1464
// see: https://github.com/eslint/eslint/pull/12613
'no-void': ['error', { allowAsStatement: true }],
'@typescript-eslint/no-floating-promises': 'error'
}
}
]

export default axiom

0 comments on commit 799dcbd

Please sign in to comment.