-
Notifications
You must be signed in to change notification settings - Fork 3
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
122 additions
and
125 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
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,2 +1,17 @@ | ||
const typescriptUnsafeConfig = []; | ||
import typescriptConfig from './typescript.js'; | ||
|
||
const typescriptUnsafeConfig = [ | ||
...typescriptConfig, | ||
{ | ||
rules: { | ||
'@typescript-eslint/no-unsafe-argument': 'off', | ||
'@typescript-eslint/no-unsafe-assignment': 'off', | ||
'@typescript-eslint/no-unsafe-call': 'off', | ||
'@typescript-eslint/no-unsafe-declaration-merging': 'off', | ||
'@typescript-eslint/no-unsafe-enum-comparison': 'off', | ||
'@typescript-eslint/no-unsafe-member-access': 'off', | ||
'@typescript-eslint/no-unsafe-return': 'off', | ||
}, | ||
}, | ||
]; | ||
export default typescriptUnsafeConfig; |
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,2 +1,106 @@ | ||
const typescriptConfig = []; | ||
import xoTypescript from 'eslint-config-xo-typescript'; | ||
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; | ||
import baseConfig from './base.js'; | ||
|
||
const typescriptConfig = [ | ||
...baseConfig, | ||
|
||
xoTypescript, | ||
{ | ||
rules: { | ||
'import/consistent-type-specifier-style': ['error', 'prefer-inline'], | ||
|
||
'@typescript-eslint/no-empty-function': 'off', | ||
'@typescript-eslint/promise-function-async': 'off', | ||
'@typescript-eslint/naming-convention': [ | ||
'error', | ||
{ | ||
selector: 'variable', | ||
modifiers: ['destructured'], | ||
// eslint-disable-next-line unicorn/no-null | ||
format: null, | ||
}, | ||
{ | ||
selector: [ | ||
'classProperty', | ||
'objectLiteralProperty', | ||
'typeProperty', | ||
'classMethod', | ||
'objectLiteralMethod', | ||
'typeMethod', | ||
'accessor', | ||
'enumMember', | ||
], | ||
// eslint-disable-next-line unicorn/no-null | ||
format: null, | ||
modifiers: ['requiresQuotes'], | ||
}, | ||
{ | ||
selector: 'variable', | ||
modifiers: ['const', 'global'], | ||
format: ['camelCase', 'PascalCase', 'UPPER_CASE'], | ||
}, | ||
], | ||
'@typescript-eslint/consistent-type-imports': [ | ||
'error', | ||
{ | ||
disallowTypeAnnotations: true, | ||
fixStyle: 'inline-type-imports', | ||
prefer: 'type-imports', | ||
}, | ||
], | ||
'@typescript-eslint/ban-types': [ | ||
'error', | ||
{ | ||
extendDefaults: false, | ||
types: { | ||
String: { | ||
message: 'Use `string` instead.', | ||
fixWith: 'string', | ||
}, | ||
Number: { | ||
message: 'Use `number` instead.', | ||
fixWith: 'number', | ||
}, | ||
Boolean: { | ||
message: 'Use `boolean` instead.', | ||
fixWith: 'boolean', | ||
}, | ||
Symbol: { | ||
message: 'Use `symbol` instead.', | ||
fixWith: 'symbol', | ||
}, | ||
BigInt: { | ||
message: 'Use `bigint` instead.', | ||
fixWith: 'bigint', | ||
}, | ||
Object: { | ||
message: | ||
'The `Object` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead. See https://github.com/typescript-eslint/typescript-eslint/pull/848', | ||
fixWith: 'Record<string, unknown>', | ||
}, | ||
'{}': { | ||
message: | ||
'The `{}` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead.', | ||
fixWith: 'Record<string, unknown>', | ||
}, | ||
object: { | ||
message: | ||
'The `object` type is hard to use. Use `Record<string, unknown>` instead. See: https://github.com/typescript-eslint/typescript-eslint/pull/848', | ||
fixWith: 'Record<string, unknown>', | ||
}, | ||
Function: 'Use a specific function type instead, like `() => void`.', | ||
'[[]]': | ||
"Don't use `[[]]`. It only allows an array with a single element which is an empty array. Use `SomeType[][]` instead.", | ||
'[[[]]]': "Don't use `[[[]]]`. Use `SomeType[][][]` instead.", | ||
'[[[[]]]]': 'ur drunk 🤡', | ||
'[[[[[]]]]]': '🦄💥', | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
|
||
eslintPluginPrettierRecommended, | ||
]; | ||
export default typescriptConfig; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.