generated from 2BAD/ts-lib-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
48 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,3 @@ | ||
import love from 'eslint-config-love' | ||
import jsdoc from 'eslint-plugin-jsdoc' | ||
import vitest from 'eslint-plugin-vitest' | ||
import tb from './build/index.js' | ||
|
||
export default [ | ||
// ignores key should be used first and without any other keys in the configuration object | ||
{ | ||
ignores: ['build', 'docs'] | ||
}, | ||
jsdoc.configs['flat/recommended-typescript-error'], | ||
love, | ||
// general | ||
{ | ||
rules: { | ||
'import/no-default-export': 'error', | ||
// don't work without typescript import specifier support | ||
'import/no-unresolved': 'off', | ||
'jsdoc/check-param-names': ['error', { checkDestructured: false }], | ||
'jsdoc/require-hyphen-before-param-description': 'error', | ||
'jsdoc/require-jsdoc': ['error', { require: { FunctionExpression: true, ArrowFunctionExpression: true } }], | ||
'jsdoc/require-param': ['error', { checkDestructured: false }], | ||
'jsdoc/require-returns': 'off', | ||
'jsdoc/require-throws': 'error', | ||
'jsdoc/tag-lines': ['error', 'any', { startLines: 1 }] | ||
} | ||
}, | ||
// typescript | ||
{ | ||
files: ['**/*.ts'], | ||
rules: { | ||
'@typescript-eslint/consistent-type-definitions': ['error', 'type'], | ||
'@typescript-eslint/non-nullable-type-assertion-style': 'off', | ||
'@typescript-eslint/promise-function-async': 'off', | ||
'@typescript-eslint/strict-boolean-expressions': ['error', { allowNullableObject: true }], | ||
'@typescript-eslint/space-before-function-paren': 'off', | ||
'n/prefer-node-protocol': 'error' | ||
} | ||
}, | ||
// vitest | ||
{ | ||
files: ['**/*.test.ts'], | ||
plugins: { | ||
vitest | ||
}, | ||
settings: { | ||
vitest: { | ||
typecheck: true | ||
} | ||
}, | ||
languageOptions: { | ||
globals: { | ||
...vitest.environments.env.globals | ||
} | ||
}, | ||
rules: { | ||
...vitest.configs.all.rules, | ||
'vitest/max-nested-describe': ['error', { max: 3 }], | ||
'vitest/no-hooks': ['error', { allow: ['afterEach'] }], | ||
'@typescript-eslint/consistent-type-imports': ['error', { disallowTypeAnnotations: false }] | ||
} | ||
} | ||
] | ||
export default [tb.configs.all] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import js from '@eslint/js' | ||
import type { Linter } from 'eslint' | ||
import ts from 'typescript-eslint' | ||
|
||
const all: Linter.FlatConfig = Object.freeze({ | ||
name: '2bad/all', | ||
...js.configs.all, | ||
...ts.configs.all | ||
}) | ||
|
||
export default all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import js from '@eslint/js' | ||
import type { Linter } from 'eslint' | ||
import ts from 'typescript-eslint' | ||
|
||
const recommended: Linter.FlatConfig = Object.freeze({ | ||
name: '2bad/recommended', | ||
...js.configs.recommended, | ||
...ts.configs.recommended | ||
}) | ||
|
||
export default recommended |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import js from '@eslint/js' | ||
import type { Linter } from 'eslint' | ||
import ts from 'typescript-eslint' | ||
|
||
const strict: Linter.FlatConfig = Object.freeze({ | ||
name: '2bad/strict', | ||
...js.configs.all, | ||
...ts.configs.strict | ||
}) | ||
|
||
export default strict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
import { go, where } from '~/quotes/parts.ts' | ||
import type { ESLint } from 'eslint' | ||
import all from './configs/all.ts' | ||
import recommended from './configs/recommended.ts' | ||
import strict from './configs/strict.ts' | ||
|
||
export const quote = `${go} ${where}` | ||
const plugin: ESLint.Plugin = { | ||
configs: { | ||
recommended, | ||
strict, | ||
all | ||
} | ||
} | ||
|
||
export default plugin |