Skip to content

Commit

Permalink
Upgrade to typescript-eslint 2
Browse files Browse the repository at this point in the history
Fixes #13
Fixes #14
  • Loading branch information
sindresorhus committed Aug 19, 2019
1 parent ed789e3 commit 1053f6b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
20 changes: 11 additions & 9 deletions index.js
Expand Up @@ -31,7 +31,9 @@ module.exports = {
'@typescript-eslint/adjacent-overload-signatures': 'error',
'@typescript-eslint/array-type': [
'error',
'array-simple'
{
default: 'array-simple'
}
],
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/ban-types': [
Expand Down Expand Up @@ -77,6 +79,14 @@ module.exports = {
],
'@typescript-eslint/class-name-casing': 'error',

'@typescript-eslint/consistent-type-assertions': [
'error',
{
assertionStyle: 'as',
objectLiteralTypeAssertions: 'allow-as-parameter'
}
],

// Disabled because it's not fully usable yet:
// https://github.com/typescript-eslint/typescript-eslint/issues/142
// '@typescript-eslint/consistent-type-definitions': [
Expand Down Expand Up @@ -132,7 +142,6 @@ module.exports = {
}
],
'@typescript-eslint/member-ordering': 'error',
'@typescript-eslint/no-angle-bracket-type-assertion': 'error',
'no-array-constructor': 'off',
'@typescript-eslint/no-array-constructor': 'error',
'no-empty-function': 'off',
Expand Down Expand Up @@ -187,13 +196,6 @@ module.exports = {
// https://github.com/typescript-eslint/typescript-eslint/issues/202
// '@typescript-eslint/no-non-null-assertion': 'error',

'@typescript-eslint/no-object-literal-type-assertion': [
'error',
{
allowAsParameter: true
}
],

// TODO: Enable this again when I target ESM output in all my TypeScript projects
// '@typescript-eslint/no-require-imports': 'error',

Expand Down
8 changes: 4 additions & 4 deletions package.json
Expand Up @@ -42,10 +42,10 @@
"simple"
],
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^1.13.0",
"@typescript-eslint/parser": "^1.13.0",
"ava": "^2.2.0",
"eslint": "^6.1.0",
"@typescript-eslint/eslint-plugin": "^2.0.0",
"@typescript-eslint/parser": "^2.0.0",
"ava": "^2.3.0",
"eslint": "^6.2.0",
"temp-write": "^4.0.0",
"typescript": "^3.5.3"
},
Expand Down
4 changes: 2 additions & 2 deletions test/test.js
Expand Up @@ -14,7 +14,7 @@ function runEslint(string, config) {
return linter.executeOnText(string).results[0].messages;
}

test('main', t => {
test.failing('main', t => {
const errors = runEslint('const foo: number = 5;', config);
t.true(hasRule(errors, '@typescript-eslint/no-inferrable-types'));
t.true(hasRule(errors, '@typescript-eslint/no-inferrable-types'), JSON.stringify(errors));
});

0 comments on commit 1053f6b

Please sign in to comment.