Skip to content

Commit

Permalink
chore: update eslint configuration to be the same as api-typings
Browse files Browse the repository at this point in the history
  • Loading branch information
SgLy committed Aug 8, 2024
1 parent f2eefe6 commit 812871d
Showing 1 changed file with 18 additions and 26 deletions.
44 changes: 18 additions & 26 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json'
},
plugins: [
'@typescript-eslint',
],
Expand All @@ -15,31 +18,19 @@ module.exports = {
'@typescript-eslint/ban-ts-comment': ['off'],
'@typescript-eslint/adjacent-overload-signatures': ['error'],
'@typescript-eslint/ban-types': ['error', {
extendDefaults: true,
types: {
Object: {
message: 'Avoid using the `Object` type. Did you mean `object`?',
fixWith: 'object'
},
Function: {
message: 'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.',
fixWith: 'function'
},
Boolean: {
message: 'Avoid using the `Boolean` type. Did you mean `boolean`?',
fixWith: 'boolean'
},
Number: {
message: 'Avoid using the `Number` type. Did you mean `number`?',
fixWith: 'number'
},
String: {
message: 'Avoid using the `String` type. Did you mean `string`?',
fixWith: 'string'
},
Symbol: {
message: 'Avoid using the `Symbol` type. Did you mean `symbol`?',
fixWith: 'symbol'
},
/**
* we are using `{}` as noop
* e.g. `type A<P> = B & (P extends Q ? C : {})`
* will get `B & C` when `P extends Q` and `B` otherwise
*/
'{}': false,
/**
* we actually need a type accepting any function-like value
* e.g. `type Methods = Record<string, Function>`
*/
'Function': false,
}
}],
'@typescript-eslint/member-delimiter-style': ['error', {
Expand All @@ -54,7 +45,7 @@ module.exports = {
}],
'@typescript-eslint/naming-convention': ['error', {
selector: 'enum',
format: ['UPPER_CASE'],
format: ['PascalCase', 'UPPER_CASE'],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
}, {
Expand All @@ -66,6 +57,7 @@ module.exports = {
'@typescript-eslint/array-type': ['error', {
default: 'array-simple',
readonly: 'array-simple'
}]
}],
'@typescript-eslint/no-unnecessary-qualifier': ['error'],
},
}

0 comments on commit 812871d

Please sign in to comment.