Skip to content

Commit 08ac914

Browse files
authored
style: indent lines with tabs instead of spaces (#633)
1 parent 69485e5 commit 08ac914

File tree

108 files changed

+15750
-15738
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+15750
-15738
lines changed

.eslintrc.json

+53-53
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,57 @@
11
{
2-
"env": {
3-
"commonjs": true,
4-
"es6": true,
5-
"node": true,
6-
"jest/globals": true
7-
},
8-
"extends": [
9-
"kentcdodds",
10-
"plugin:@typescript-eslint/eslint-recommended",
11-
"plugin:@typescript-eslint/recommended",
12-
"prettier",
13-
"plugin:jest/recommended",
14-
"plugin:jest-formatting/recommended"
15-
],
16-
"plugins": ["@typescript-eslint", "jest", "jest-formatting"],
17-
"globals": {
18-
"Atomics": "readonly",
19-
"SharedArrayBuffer": "readonly"
20-
},
21-
"parser": "@typescript-eslint/parser",
22-
"parserOptions": {
23-
"project": "./tsconfig.eslint.json"
24-
},
25-
"rules": {
26-
// TS
27-
"@typescript-eslint/explicit-function-return-type": "off",
28-
"@typescript-eslint/no-unused-vars": [
29-
"warn",
30-
{ "argsIgnorePattern": "^_" }
31-
],
32-
"@typescript-eslint/no-use-before-define": "off",
2+
"env": {
3+
"commonjs": true,
4+
"es6": true,
5+
"node": true,
6+
"jest/globals": true
7+
},
8+
"extends": [
9+
"kentcdodds",
10+
"plugin:@typescript-eslint/eslint-recommended",
11+
"plugin:@typescript-eslint/recommended",
12+
"prettier",
13+
"plugin:jest/recommended",
14+
"plugin:jest-formatting/recommended"
15+
],
16+
"plugins": ["@typescript-eslint", "jest", "jest-formatting"],
17+
"globals": {
18+
"Atomics": "readonly",
19+
"SharedArrayBuffer": "readonly"
20+
},
21+
"parser": "@typescript-eslint/parser",
22+
"parserOptions": {
23+
"project": "./tsconfig.eslint.json"
24+
},
25+
"rules": {
26+
// TS
27+
"@typescript-eslint/explicit-function-return-type": "off",
28+
"@typescript-eslint/no-unused-vars": [
29+
"warn",
30+
{ "argsIgnorePattern": "^_" }
31+
],
32+
"@typescript-eslint/no-use-before-define": "off",
3333

34-
// ESLint
35-
"max-lines-per-function": "off",
36-
"no-restricted-imports": [
37-
"error",
38-
{
39-
"patterns": ["@typescript-eslint/utils/dist/*"]
40-
}
41-
],
34+
// ESLint
35+
"max-lines-per-function": "off",
36+
"no-restricted-imports": [
37+
"error",
38+
{
39+
"patterns": ["@typescript-eslint/utils/dist/*"]
40+
}
41+
],
4242

43-
// Import
44-
"import/no-import-module-exports": "off",
45-
"import/order": [
46-
"warn",
47-
{
48-
"groups": ["builtin", "external", "parent", "sibling", "index"],
49-
"newlines-between": "always",
50-
"alphabetize": {
51-
"order": "asc",
52-
"caseInsensitive": false
53-
}
54-
}
55-
]
56-
}
43+
// Import
44+
"import/no-import-module-exports": "off",
45+
"import/order": [
46+
"warn",
47+
{
48+
"groups": ["builtin", "external", "parent", "sibling", "index"],
49+
"newlines-between": "always",
50+
"alphabetize": {
51+
"order": "asc",
52+
"caseInsensitive": false
53+
}
54+
}
55+
]
56+
}
5757
}

.lintstagedrc

-8
This file was deleted.

.prettierrc.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module.exports = {
2-
singleQuote: true,
2+
singleQuote: true,
3+
useTabs: true,
34
};

.releaserc.json

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
2-
"pkgRoot": "dist",
3-
"branches": [
4-
"+([0-9])?(.{+([0-9]),x}).x",
5-
"main",
6-
"next",
7-
"next-major",
8-
{
9-
"name": "beta",
10-
"prerelease": true
11-
},
12-
{
13-
"name": "alpha",
14-
"prerelease": true
15-
}
16-
]
2+
"pkgRoot": "dist",
3+
"branches": [
4+
"+([0-9])?(.{+([0-9]),x}).x",
5+
"main",
6+
"next",
7+
"next-major",
8+
{
9+
"name": "beta",
10+
"prerelease": true
11+
},
12+
{
13+
"name": "alpha",
14+
"prerelease": true
15+
}
16+
]
1717
}

CONTRIBUTING.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ If you wish to run a single test while developing locally, add `only: true` to t
118118
119119
```javascript
120120
valid: [
121-
{
122-
only: true,
123-
code: `...`,
124-
},
121+
{
122+
only: true,
123+
code: `...`,
124+
},
125125
];
126126
```
127127
@@ -137,9 +137,9 @@ Since the plugin will report differently depending on which Testing Library pack
137137
import { render } from '@testing-library/react';
138138

139139
test('should report invalid render usage', () => {
140-
// the following line is the actual code you needed to test your rule,
141-
// but everything else helps finding edge cases and makes it more robust.
142-
const wrapper = render(<Component />);
140+
// the following line is the actual code you needed to test your rule,
141+
// but everything else helps finding edge cases and makes it more robust.
142+
const wrapper = render(<Component />);
143143
});
144144
```
145145

README.md

+41-41
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,20 @@ Add `testing-library` to the plugins section of your `.eslintrc` configuration f
5858

5959
```json
6060
{
61-
"plugins": ["testing-library"]
61+
"plugins": ["testing-library"]
6262
}
6363
```
6464

6565
Then configure the rules you want to use within `rules` property of your `.eslintrc`:
6666

6767
```json
6868
{
69-
"rules": {
70-
"testing-library/await-async-query": "error",
71-
"testing-library/no-await-sync-query": "error",
72-
"testing-library/no-debugging-utils": "warn",
73-
"testing-library/no-dom-import": "off"
74-
}
69+
"rules": {
70+
"testing-library/await-async-query": "error",
71+
"testing-library/no-await-sync-query": "error",
72+
"testing-library/no-debugging-utils": "warn",
73+
"testing-library/no-dom-import": "off"
74+
}
7575
}
7676
```
7777

@@ -88,19 +88,19 @@ Assuming you are using the same pattern for your test files as [Jest by default]
8888
```json5
8989
// .eslintrc
9090
{
91-
// 1) Here we have our usual config which applies to the whole project, so we don't put testing-library preset here.
92-
extends: ['airbnb', 'plugin:prettier/recommended'],
93-
94-
// 2) We load other plugins than eslint-plugin-testing-library globally if we want to.
95-
plugins: ['react-hooks'],
96-
97-
overrides: [
98-
{
99-
// 3) Now we enable eslint-plugin-testing-library rules or preset only for matching testing files!
100-
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
101-
extends: ['plugin:testing-library/react'],
102-
},
103-
],
91+
// 1) Here we have our usual config which applies to the whole project, so we don't put testing-library preset here.
92+
extends: ['airbnb', 'plugin:prettier/recommended'],
93+
94+
// 2) We load other plugins than eslint-plugin-testing-library globally if we want to.
95+
plugins: ['react-hooks'],
96+
97+
overrides: [
98+
{
99+
// 3) Now we enable eslint-plugin-testing-library rules or preset only for matching testing files!
100+
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
101+
extends: ['plugin:testing-library/react'],
102+
},
103+
],
104104
}
105105
```
106106

@@ -118,14 +118,14 @@ Since each one of these configurations is aimed at a particular Testing Library
118118
```json5
119119
// ❌ Don't do this
120120
{
121-
extends: ['plugin:testing-library/dom', 'plugin:testing-library/react'],
121+
extends: ['plugin:testing-library/dom', 'plugin:testing-library/react'],
122122
}
123123
```
124124

125125
```json5
126126
// ✅ Just do this instead
127127
{
128-
extends: ['plugin:testing-library/react'],
128+
extends: ['plugin:testing-library/react'],
129129
}
130130
```
131131

@@ -138,7 +138,7 @@ To enable this configuration use the `extends` property in your
138138

139139
```json
140140
{
141-
"extends": ["plugin:testing-library/dom"]
141+
"extends": ["plugin:testing-library/dom"]
142142
}
143143
```
144144

@@ -151,7 +151,7 @@ To enable this configuration use the `extends` property in your
151151

152152
```json
153153
{
154-
"extends": ["plugin:testing-library/angular"]
154+
"extends": ["plugin:testing-library/angular"]
155155
}
156156
```
157157

@@ -164,7 +164,7 @@ To enable this configuration use the `extends` property in your
164164

165165
```json
166166
{
167-
"extends": ["plugin:testing-library/react"]
167+
"extends": ["plugin:testing-library/react"]
168168
}
169169
```
170170

@@ -177,7 +177,7 @@ To enable this configuration use the `extends` property in your
177177

178178
```json
179179
{
180-
"extends": ["plugin:testing-library/vue"]
180+
"extends": ["plugin:testing-library/vue"]
181181
}
182182
```
183183

@@ -190,7 +190,7 @@ To enable this configuration use the `extends` property in your
190190

191191
```json
192192
{
193-
"extends": ["plugin:testing-library/marko"]
193+
"extends": ["plugin:testing-library/marko"]
194194
}
195195
```
196196

@@ -255,9 +255,9 @@ The name of your custom utility file from where you re-export everything from th
255255
```json5
256256
// .eslintrc
257257
{
258-
settings: {
259-
'testing-library/utils-module': 'my-custom-test-utility-file',
260-
},
258+
settings: {
259+
'testing-library/utils-module': 'my-custom-test-utility-file',
260+
},
261261
}
262262
```
263263

@@ -270,9 +270,9 @@ A list of function names that are valid as Testing Library custom renders, or `"
270270
```json5
271271
// .eslintrc
272272
{
273-
settings: {
274-
'testing-library/custom-renders': ['display', 'renderWithProviders'],
275-
},
273+
settings: {
274+
'testing-library/custom-renders': ['display', 'renderWithProviders'],
275+
},
276276
}
277277
```
278278

@@ -285,9 +285,9 @@ A list of query names/patterns that are valid as Testing Library custom queries,
285285
```json5
286286
// .eslintrc
287287
{
288-
settings: {
289-
'testing-library/custom-queries': ['ByIcon', 'getByComplexText'],
290-
},
288+
settings: {
289+
'testing-library/custom-queries': ['ByIcon', 'getByComplexText'],
290+
},
291291
}
292292
```
293293

@@ -300,11 +300,11 @@ Since each Shared Setting is related to one Aggressive Reporting mechanism, and
300300
```json5
301301
// .eslintrc
302302
{
303-
settings: {
304-
'testing-library/utils-module': 'off',
305-
'testing-library/custom-renders': 'off',
306-
'testing-library/custom-queries': 'off',
307-
},
303+
settings: {
304+
'testing-library/utils-module': 'off',
305+
'testing-library/custom-renders': 'off',
306+
'testing-library/custom-queries': 'off',
307+
},
308308
}
309309
```
310310

commitlint.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
extends: ['@commitlint/config-conventional'],
2+
extends: ['@commitlint/config-conventional'],
33
};

0 commit comments

Comments
 (0)