Skip to content

Commit

Permalink
Re-enable some disabled rules
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Apr 14, 2020
1 parent 3183fad commit e870168
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 25 deletions.
42 changes: 20 additions & 22 deletions index.js
Expand Up @@ -94,17 +94,14 @@ module.exports = {
allowSingleLine: false
}
],

// Disabled for now. It crashes when run on the Caprine codebase.
// 'comma-spacing': 'off',
// '@typescript-eslint/comma-spacing': [
// 'error',
// {
// before: false,
// after: true
// }
// ],

'comma-spacing': 'off',
'@typescript-eslint/comma-spacing': [
'error',
{
before: false,
after: true
}
],
'default-param-last': 'off',
'@typescript-eslint/default-param-last': 'error',
'@typescript-eslint/consistent-type-assertions': [
Expand All @@ -115,29 +112,33 @@ module.exports = {
}
],

// Disabled because it's not fully usable yet:
// https://github.com/typescript-eslint/typescript-eslint/issues/142
// This rule is fine. I just don't want to deal with the churn yet. Enable this in 2022.
// '@typescript-eslint/consistent-type-definitions': [
// 'error',
// 'type'
// ],

// Disabled because it's too annoying. Enable it when it's more mature, smarter, and more flexible.
// https://github.com/typescript-eslint/typescript-eslint/search?q=%22explicit-function-return-type%22&state=open&type=Issues
// '@typescript-eslint/explicit-function-return-type': [
// 'error',
// {
// allowExpressions: true,
// allowTypedFunctionExpressions: true
// allowTypedFunctionExpressions: true,
// allowHigherOrderFunctions: true,
// allowConciseArrowFunctionExpressionsStartingWithVoid: false
// }
// ],

// Disabled for now as it has too many false-positives.
// https://github.com/typescript-eslint/typescript-eslint/search?q=%22explicit-module-boundary-types%22&state=open&type=Issues
// '@typescript-eslint/explicit-module-boundary-types': [
// 'error',
// {
// allowTypedFunctionExpressions: true,
// allowHigherOrderFunctions: true,
// allowDirectConstAssertionInArrowFunctions: true
// allowDirectConstAssertionInArrowFunctions: true,
// shouldTrackReferences: true
// }
// ],

Expand Down Expand Up @@ -255,7 +256,7 @@ module.exports = {
'@typescript-eslint/no-extra-non-null-assertion': 'error',

// Disabled because it's buggy. It transforms `...(personalToken ? {Authorization: `token ${personalToken}`} : {})` into `...personalToken ? {Authorization: `token ${personalToken}`} : {}` which is not valid.
// TODO: Report this issue.
// https://github.com/typescript-eslint/typescript-eslint/search?q=%22no-extra-parens%22&state=open&type=Issues
'no-extra-parens': 'off',
// '@typescript-eslint/no-extra-parens': [
// 'error',
Expand Down Expand Up @@ -434,7 +435,8 @@ module.exports = {
],
'@typescript-eslint/type-annotation-spacing': 'error',

// Disabled as it crashes on most code
// Disabled as it crashes on most code.
// https://github.com/typescript-eslint/typescript-eslint/search?q=%22unbound-method%22&state=open&type=Issues
// '@typescript-eslint/unbound-method': [
// 'error',
// {
Expand All @@ -448,11 +450,7 @@ module.exports = {
// TypeScript supports these features
'no-useless-catch': 'error',

// The rule is deprecated in ESLint and it doesn't fully make sense for TypeScript.
// TODO: Remove this when the rule is removed from XO.
'valid-jsdoc': 'off',

// Disabled because of https://github.com/typescript-eslint/typescript-eslint/issues/60
'no-redeclare': 'off',
'no-redeclare': 'off'
}
};
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -44,15 +44,15 @@
"simple"
],
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^2.27.0",
"@typescript-eslint/parser": "^2.27.0",
"@typescript-eslint/eslint-plugin": "^2.28.0",
"@typescript-eslint/parser": "^2.28.0",
"ava": "^2.4.0",
"eslint": "^6.8.0",
"temp-write": "^4.0.0",
"typescript": "^3.8.3"
},
"peerDependencies": {
"@typescript-eslint/eslint-plugin": ">=2.27.0",
"@typescript-eslint/eslint-plugin": ">=2.28.0",
"eslint": ">=6.6.0",
"typescript": ">=3.5.3"
}
Expand Down

0 comments on commit e870168

Please sign in to comment.