Skip to content

chore: turn on plugin-test-formatting rule #1822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 92 commits into from
Mar 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
09d8493
chore: turn on the rule
bradzacher Mar 29, 2020
eb44069
chore: adjacent-overload-signatures
bradzacher Mar 29, 2020
9d712df
chore: array-type
bradzacher Mar 29, 2020
5807d58
chore: prefer-ast-types-enum
bradzacher Mar 29, 2020
af9715e
chore: no-typescript-estree-import
bradzacher Mar 29, 2020
5561c4b
chore: unified-signatures
bradzacher Mar 29, 2020
9275e77
chore: unbound-method
bradzacher Mar 29, 2020
dc960ba
chore: typedef
bradzacher Mar 29, 2020
ea6891f
chore: type-annotation-spacing
bradzacher Mar 30, 2020
0ca9647
chore: triple-slash-reference
bradzacher Mar 30, 2020
1bb06fc
chore: switch-exhaustiveness-check
bradzacher Mar 30, 2020
f21fa04
chore: space-before-function-paren
bradzacher Mar 30, 2020
f314b0e
chore: semi
bradzacher Mar 30, 2020
0405b4a
chore: return-await
bradzacher Mar 30, 2020
7de523d
chore: restrict-template-expressions
bradzacher Mar 30, 2020
cc31234
chore: restrict-plus-operands
bradzacher Mar 30, 2020
2a33b47
chore: require-await
bradzacher Mar 30, 2020
c1151fa
chore: require-array-sort-compare
bradzacher Mar 30, 2020
fc290c6
chore: quotes
bradzacher Mar 30, 2020
33dd061
chore: promise-function-async
bradzacher Mar 30, 2020
8dd893c
chore: prefer-regexp-exec
bradzacher Mar 30, 2020
d9b0e84
chore: prefer-readonly
bradzacher Mar 30, 2020
b9ee7d7
chore: prefer-readonly-parameter-types
bradzacher Mar 30, 2020
19a7d5b
chore: prefer-optional-chain
bradzacher Mar 30, 2020
b46c65d
chore: prefer-namespace-keyword
bradzacher Mar 30, 2020
ab27ad5
chore: prefer-function-type
bradzacher Mar 30, 2020
107d14d
chore: prefer-for-of
bradzacher Mar 30, 2020
7df018b
chore: prefer-as-const
bradzacher Mar 30, 2020
ec6f5f6
chore: no-var-requires
bradzacher Mar 30, 2020
4b6cbe5
chore: no-useless-constructor
bradzacher Mar 30, 2020
cc6a199
chore: no-use-before-define
bradzacher Mar 30, 2020
c4c1073
chore: no-unused-vars
bradzacher Mar 30, 2020
6f9ff08
chore: no-unused-expressions
bradzacher Mar 30, 2020
5455ca3
chore: no-untyped-public-signature
bradzacher Mar 30, 2020
8a63f6c
chore: no-unsafe-return
bradzacher Mar 30, 2020
482d164
chore: no-unsafe-member-access
bradzacher Mar 30, 2020
4afb879
chore: no-unsafe-call
bradzacher Mar 30, 2020
ffbc0e2
chore: no-unnecessary-type-assertion
bradzacher Mar 30, 2020
e023254
chore: no-unnecessary-type-arguments
bradzacher Mar 30, 2020
bd22cb5
chore: no-unnecessary-qualifier
bradzacher Mar 30, 2020
0bb96bd
chore: no-unnecessary-conditionals
bradzacher Mar 30, 2020
2245c5e
chore: no-unnecessary-boolean-literal-compare
bradzacher Mar 30, 2020
5c8781b
chore: no-type-alias
bradzacher Mar 30, 2020
e545196
chore: no-throw-literal
bradzacher Mar 30, 2020
bc3f697
chore: no-this-alias
bradzacher Mar 30, 2020
8ab07da
chore: no-require-imports
bradzacher Mar 30, 2020
9a49443
chore: no-parameter-properties
bradzacher Mar 30, 2020
9c3eeef
chore: no-non-null-assertion
bradzacher Mar 30, 2020
06ee33b
chore: no-non-null-asserted-optional-chain
bradzacher Mar 30, 2020
0b628bc
chore: no-namespace
bradzacher Mar 30, 2020
eed2863
chore: no-misused-promises
bradzacher Mar 30, 2020
6ad024b
chore: no-misused-new
bradzacher Mar 30, 2020
265742c
chore: no-magic-numbers
bradzacher Mar 30, 2020
6dac36d
chore: no-inferrable-types
bradzacher Mar 30, 2020
355d17c
chore: no-implied-eval
bradzacher Mar 30, 2020
bb213a5
chore: no-for-in-array
bradzacher Mar 30, 2020
505e41d
chore: no-floating-promises
bradzacher Mar 30, 2020
2455704
chore: no-extraneous-class
bradzacher Mar 30, 2020
6270d7e
chore: no-extra-semi
bradzacher Mar 30, 2020
3ce1cf3
chore: no-extra-parens
bradzacher Mar 30, 2020
457f5bf
chore: no-extra-non-null-assertion
bradzacher Mar 30, 2020
89a2320
chore: no-explicit-any
bradzacher Mar 30, 2020
5843fd2
chore: no-empty-interface
bradzacher Mar 30, 2020
7fc5c97
chore: no-empty-function
bradzacher Mar 30, 2020
da553db
chore: no-dynamic-delete
bradzacher Mar 30, 2020
223dc75
chore: no-dupe-class-members
bradzacher Mar 30, 2020
6a2cedd
chore: no-base-to-string
bradzacher Mar 30, 2020
7519726
chore: no-array-constructor
bradzacher Mar 30, 2020
0d43c32
chore: naming-convention
bradzacher Mar 30, 2020
2caf49f
chore: member-ordering
bradzacher Mar 30, 2020
7ebfafe
chore: member-naming
bradzacher Mar 30, 2020
48de9cd
chore: member-delimiter-style
bradzacher Mar 30, 2020
c089d91
chore: interface-name-prefix
bradzacher Mar 30, 2020
03f3c10
chore: generic-type-naming
bradzacher Mar 30, 2020
6485291
chore: func-call-spacing
bradzacher Mar 30, 2020
6a9f65c
chore: explicit-module-boundary-types
bradzacher Mar 30, 2020
0e6d87d
chore: explicit-member-accessibility
bradzacher Mar 30, 2020
df671bc
chore: explicit-function-return-type
bradzacher Mar 30, 2020
f075c71
chore: default-param-last
bradzacher Mar 30, 2020
fbad51c
chore: consistent-type-definitions
bradzacher Mar 30, 2020
cd150aa
chore: comma-spacing
bradzacher Mar 30, 2020
2c424d5
chore: class-name-casing
bradzacher Mar 30, 2020
026eb19
chore: class-literal-property-style
bradzacher Mar 30, 2020
bc46b74
chore: camelcase
bradzacher Mar 30, 2020
e18cb6a
chore: brace-style
bradzacher Mar 30, 2020
5970e3a
chore: ban-types
bradzacher Mar 30, 2020
33c2ed8
chore: ban-ts-ignore
bradzacher Mar 30, 2020
85fcb6c
chore: ban-ts-comment
bradzacher Mar 30, 2020
f94b434
chore: await-thenable
bradzacher Mar 30, 2020
407694a
chore: adjacent-overload-signatures
bradzacher Mar 30, 2020
b622e8c
chore: indent
bradzacher Mar 30, 2020
dfb97cd
chore: no-empty-function - 2
bradzacher Mar 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ module.exports = {
'@typescript-eslint/internal/no-typescript-estree-import': 'error',
},
},
// rule source files
// plugin rule source files
{
files: [
'packages/eslint-plugin-internal/src/rules/**/*.ts',
Expand All @@ -187,6 +187,17 @@ module.exports = {
'import/no-default-export': 'off',
},
},
// plugin rule tests
{
files: [
'packages/eslint-plugin-internal/tests/rules/**/*.test.ts',
'packages/eslint-plugin-tslint/tests/rules/**/*.test.ts',
'packages/eslint-plugin/tests/rules/**/*.test.ts',
],
rules: {
'@typescript-eslint/internal/plugin-test-formatting': 'error',
},
},
// tools and tests
{
files: ['**/tools/**/*.ts', '**/tests/**/*.ts'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ const ruleTester = new RuleTester({

ruleTester.run('no-typescript-estree-import', rule, {
valid: [
'import { foo } from "@typescript-eslint/experimental-utils";',
'import foo from "@typescript-eslint/experimental-utils";',
'import * as foo from "@typescript-eslint/experimental-utils";',
"import { foo } from '@typescript-eslint/experimental-utils';",
"import foo from '@typescript-eslint/experimental-utils';",
"import * as foo from '@typescript-eslint/experimental-utils';",
],
invalid: batchedSingleLineTests({
code: `
import { foo } from "@typescript-eslint/typescript-estree";
import foo from "@typescript-eslint/typescript-estree";
import * as foo from "@typescript-eslint/typescript-estree";
import { foo } from '@typescript-eslint/typescript-estree';
import foo from '@typescript-eslint/typescript-estree';
import * as foo from '@typescript-eslint/typescript-estree';
`,
output: `
import { foo } from "@typescript-eslint/experimental-utils";
import foo from "@typescript-eslint/experimental-utils";
import * as foo from "@typescript-eslint/experimental-utils";
import { foo } from '@typescript-eslint/experimental-utils';
import foo from '@typescript-eslint/experimental-utils';
import * as foo from '@typescript-eslint/experimental-utils';
`,
errors: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const a = 1;
${PARENT_INDENT}\``,
wrap`noFormat\`const a = 1;\``,
// sanity check suggestion validation
// eslint-disable-next-line @typescript-eslint/internal/plugin-test-formatting
`
ruleTester.run({
invalid: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@ const ruleTester = new RuleTester({

ruleTester.run('prefer-ast-types-enum', rule, {
valid: [
'node.type === "constructor"',
'node.type === AST_NODE_TYPES.Literal',
'node.type === AST_TOKEN_TYPES.Keyword',
'node.type === 1',
"node.type === 'constructor';",
'node.type === AST_NODE_TYPES.Literal;',
'node.type === AST_TOKEN_TYPES.Keyword;',
'node.type === 1;',
`
enum MY_ENUM {
Literal = 1
}
enum MY_ENUM {
Literal = 1,
}
`,
`
enum AST_NODE_TYPES {
Literal = 'Literal'
}
enum AST_NODE_TYPES {
Literal = 'Literal',
}
`,
],
invalid: batchedSingleLineTests({
code: `
node.type === 'Literal'
node.type === 'Keyword'
node.type === 'Literal';
node.type === 'Keyword';
`,
output: `
node.type === AST_NODE_TYPES.Literal
node.type === AST_TOKEN_TYPES.Keyword
node.type === AST_NODE_TYPES.Literal;
node.type === AST_TOKEN_TYPES.Keyword;
`,
errors: [
{
Expand Down
Loading