Skip to content

Commit

Permalink
feat(@typescript-eslint): enable some new rules
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Jul 14, 2023
1 parent f3b63ad commit 6a3b751
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions @typescript-eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ const config = {
'@typescript-eslint/no-invalid-this': 'error',
'@typescript-eslint/no-loop-func': 'error',
'@typescript-eslint/no-meaningless-void-operator': 'error',
'@typescript-eslint/no-mixed-enums': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-namespace': [
'off', // todo: need to audit existing codebase to see if declare is fine
{
Expand Down Expand Up @@ -102,6 +104,7 @@ const config = {
'@typescript-eslint/prefer-ts-expect-error': 'error',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/require-array-sort-compare': 'warn',
'@typescript-eslint/sort-type-constituents': 'error',
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'@typescript-eslint/unified-signatures': 'warn', // can be a bit wrong
'array-callback-return': 'off',
Expand Down
5 changes: 3 additions & 2 deletions test/configs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const determinePluginPackageName = (plugin: string): string => {
const requireConfig = (
config: string
): ESLint.Linter.Config &
Required<Pick<ESLint.Linter.Config, 'plugins' | 'extends' | 'rules'>> => ({
Required<Pick<ESLint.Linter.Config, 'extends' | 'plugins' | 'rules'>> => ({
plugins: [],
extends: [],
rules: {},
Expand Down Expand Up @@ -205,7 +205,8 @@ describe('for each config file', () => {
config.parser
);
expect(packageJson.peerDependenciesMeta).toHaveProperty(
config.parser as string,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
config.parser!,
{ optional: true }
);
});
Expand Down

0 comments on commit 6a3b751

Please sign in to comment.