Skip to content

Commit

Permalink
feat(typescript): list all TypeScript rules (#435)
Browse files Browse the repository at this point in the history
  • Loading branch information
ybiquitous authored Aug 20, 2019
1 parent f70e045 commit 3246efc
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
37 changes: 37 additions & 0 deletions rules/plugins/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,41 @@ module.exports = {
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
],

rules: {
"@typescript-eslint/array-type": "off",
"@typescript-eslint/await-thenable": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/explicit-member-accessibility": ["error", { accessibility: "no-public" }],
"@typescript-eslint/generic-type-naming": "off",
"@typescript-eslint/member-naming": "off",
"@typescript-eslint/member-ordering": "off",
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-for-in-array": "off",
"@typescript-eslint/no-magic-numbers": "off",
"@typescript-eslint/no-misused-promises": "off",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-type-alias": "off",
"@typescript-eslint/no-unnecessary-qualifier": "off",
"@typescript-eslint/no-unnecessary-type-arguments": "off",
"@typescript-eslint/no-unnecessary-type-assertion": "off",
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": "error", // eslint-disable-line sort-keys
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-includes": "off",
"@typescript-eslint/prefer-readonly": "off",
"@typescript-eslint/prefer-regexp-exec": "off",
"@typescript-eslint/prefer-string-starts-ends-with": "off",
"@typescript-eslint/promise-function-async": "off",
"@typescript-eslint/require-array-sort-compare": "off",
"@typescript-eslint/require-await": "off",
"@typescript-eslint/restrict-plus-operands": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/typedef": "off",
"@typescript-eslint/unbound-method": "off",
"@typescript-eslint/unified-signatures": "error",
},
};
6 changes: 0 additions & 6 deletions test/no-unused-rules.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ const { $, lintConfigFiles } = require("./helper");

test("no unused rules", t => {
lintConfigFiles.forEach(file => {
// FIXME: `Error: Cannot find module 'eslint-plugin-@typescript-eslint'`
if (file === "typescript.js") {
console.warn(`Skip '${file}' to avoid an error.`); // eslint-disable-line no-console
return;
}

$("eslint-find-rules", "--unused", file);
t.pass(file);
});
Expand Down

0 comments on commit 3246efc

Please sign in to comment.