Skip to content

Commit bdb7f37

Browse files
rekmarksrickycodes
andauthored
Standardize prettier configuration (MetaMask#4182)
* Standardize prettier configuration * fixup! Standardize prettier configuration * update snapshot Co-authored-by: Ricky Miller <[email protected]>
1 parent 26a69a2 commit bdb7f37

File tree

718 files changed

+130977
-117001
lines changed

Some content is hidden

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

718 files changed

+130977
-117001
lines changed

.editorconfig

+2-6
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,14 @@ root = true
44
[*]
55
charset = utf-8
66
end_of_line = lf
7-
indent_size = 4
8-
indent_style = tab
7+
indent_size = 2
8+
indent_style = space
99
insert_final_newline = true
1010
trim_trailing_whitespace = true
1111

1212
[*.md]
1313
trim_trailing_whitespace = false
1414

15-
[{package,package-lock}.json]
16-
indent_size = 2
17-
indent_style = space
18-
1915
# Windows files
2016
[*.bat]
2117
end_of_line = crlf

.eslintrc.js

+150-141
Original file line numberDiff line numberDiff line change
@@ -1,144 +1,153 @@
11
// eslint-disable-next-line import/no-commonjs
22
module.exports = {
3-
root: true,
4-
parser: 'babel-eslint',
5-
extends: ['@react-native-community', 'eslint:recommended', 'plugin:import/warnings', 'plugin:react/recommended'],
6-
overrides: [
7-
{
8-
files: ['*.{ts,tsx}'],
9-
extends: ['@metamask/eslint-config-typescript'],
10-
},
11-
],
12-
globals: {
13-
process: true,
14-
beforeAll: true,
15-
afterAll: true,
16-
describe: true,
17-
expect: true,
18-
it: true,
19-
jasmine: true,
20-
jest: true,
21-
spyOn: true,
22-
element: true,
23-
by: true,
24-
beforeEach: true,
25-
device: true,
26-
waitFor: true,
27-
__DEV__: true,
28-
},
29-
settings: {
30-
'import/resolver': {
31-
typescript: {}, // this loads <rootdir>/tsconfig.json to eslint
32-
},
33-
},
34-
rules: {
35-
'no-catch-shadow': 0,
36-
'no-console': ['error', { allow: ['warn', 'error'] }],
37-
quotes: [
38-
'error',
39-
'single',
40-
{
41-
avoidEscape: true,
42-
allowTemplateLiterals: true,
43-
},
44-
],
45-
'comma-dangle': 0,
46-
curly: 0,
47-
'no-shadow': 0,
48-
'no-bitwise': 0,
49-
'class-methods-use-this': 0,
50-
'eol-last': 1,
51-
'import/no-named-as-default': 0,
52-
'no-invalid-this': 0,
53-
'no-new': 0,
54-
'react/jsx-handler-names': 0,
55-
'react/no-did-mount-set-state': 0,
56-
'react/prefer-stateless-function': 0,
57-
'require-atomic-updates': 0,
58-
'array-callback-return': 2,
59-
'arrow-body-style': 2,
60-
'dot-notation': 2,
61-
eqeqeq: 2,
62-
'import/no-amd': 2,
63-
'import/no-commonjs': 2,
64-
'import/no-duplicates': 2,
65-
'import/no-extraneous-dependencies': 2,
66-
'import/no-mutable-exports': 2,
67-
'import/no-namespace': 2,
68-
'import/no-nodejs-modules': 2,
69-
'import/prefer-default-export': 2,
70-
'no-alert': 2,
71-
'no-constant-condition': [
72-
2,
73-
{
74-
checkLoops: false,
75-
},
76-
],
77-
'no-duplicate-imports': 2,
78-
'no-empty-function': 2,
79-
'no-else-return': 2,
80-
'no-eval': 2,
81-
'no-extend-native': 2,
82-
'no-extra-bind': 2,
83-
'no-global-assign': 2,
84-
'no-implicit-globals': 2,
85-
'no-implied-eval': 2,
86-
'no-lonely-if': 2,
87-
'no-loop-func': 2,
88-
'no-new-func': 2,
89-
'no-new-wrappers': 2,
90-
'no-proto': 2,
91-
'no-script-url': 2,
92-
'no-self-compare': 2,
93-
'no-throw-literal': 2,
94-
'no-unmodified-loop-condition': 2,
95-
'no-unneeded-ternary': [
96-
2,
97-
{
98-
defaultAssignment: false,
99-
},
100-
],
101-
'no-unsafe-negation': 2,
102-
'no-unused-expressions': 'off',
103-
'no-use-before-define': [2, 'nofunc'],
104-
'no-useless-call': 2,
105-
'no-useless-computed-key': 2,
106-
'no-useless-concat': 2,
107-
'no-useless-constructor': 2,
108-
'no-useless-rename': 2,
109-
'no-var': 2,
110-
'no-with': 2,
111-
'object-shorthand': 2,
112-
'operator-assignment': 2,
113-
'prefer-arrow-callback': 2,
114-
'prefer-const': 2,
115-
'prefer-rest-params': 2,
116-
'prefer-spread': 2,
117-
'import/no-unresolved': 2,
118-
'eslint-comments/no-unlimited-disable': 0,
119-
'eslint-comments/no-unused-disable': 0,
120-
'react-native/no-color-literals': 2,
121-
'react-native/no-inline-styles': 2,
122-
'react-native/no-unused-styles': 0,
123-
'react-native/split-platform-components': 2,
124-
'react/jsx-boolean-value': 2,
125-
'react/jsx-key': 1,
126-
'react/jsx-no-bind': 0,
127-
'react/jsx-pascal-case': 2,
128-
'react/jsx-wrap-multilines': 2,
129-
'react/no-danger': 2,
130-
'react/no-did-update-set-state': 2,
131-
'react/no-find-dom-node': 2,
132-
'react/no-multi-comp': [
133-
2,
134-
{
135-
ignoreStateless: true,
136-
},
137-
],
138-
'react/no-render-return-value': 2,
139-
'react/no-string-refs': 2,
140-
'react/no-unused-prop-types': 2,
141-
'react/prefer-es6-class': 2,
142-
radix: 0,
143-
},
3+
root: true,
4+
parser: 'babel-eslint',
5+
extends: [
6+
'@react-native-community',
7+
'eslint:recommended',
8+
'plugin:import/warnings',
9+
'plugin:react/recommended',
10+
],
11+
12+
overrides: [
13+
{
14+
files: ['*.{ts,tsx}'],
15+
extends: ['@metamask/eslint-config-typescript'],
16+
},
17+
],
18+
19+
globals: {
20+
process: true,
21+
beforeAll: true,
22+
afterAll: true,
23+
describe: true,
24+
expect: true,
25+
it: true,
26+
jasmine: true,
27+
jest: true,
28+
spyOn: true,
29+
element: true,
30+
by: true,
31+
beforeEach: true,
32+
device: true,
33+
waitFor: true,
34+
__DEV__: true,
35+
},
36+
37+
settings: {
38+
'import/resolver': {
39+
typescript: {}, // this loads <rootdir>/tsconfig.json to eslint
40+
},
41+
},
42+
43+
rules: {
44+
'no-catch-shadow': 0,
45+
'no-console': ['error', { allow: ['warn', 'error'] }],
46+
quotes: [
47+
'error',
48+
'single',
49+
{
50+
avoidEscape: true,
51+
allowTemplateLiterals: true,
52+
},
53+
],
54+
'comma-dangle': 0,
55+
curly: 0,
56+
'no-shadow': 0,
57+
'no-bitwise': 0,
58+
'class-methods-use-this': 0,
59+
'eol-last': 1,
60+
'import/no-named-as-default': 0,
61+
'no-invalid-this': 0,
62+
'no-new': 0,
63+
'react/jsx-handler-names': 0,
64+
'react/no-did-mount-set-state': 0,
65+
'react/prefer-stateless-function': 0,
66+
'require-atomic-updates': 0,
67+
'array-callback-return': 2,
68+
'arrow-body-style': 2,
69+
'dot-notation': 2,
70+
eqeqeq: 2,
71+
'import/no-amd': 2,
72+
'import/no-commonjs': 2,
73+
'import/no-duplicates': 2,
74+
'import/no-extraneous-dependencies': 2,
75+
'import/no-mutable-exports': 2,
76+
'import/no-namespace': 2,
77+
'import/no-nodejs-modules': 2,
78+
'import/prefer-default-export': 2,
79+
'no-alert': 2,
80+
'no-constant-condition': [
81+
2,
82+
{
83+
checkLoops: false,
84+
},
85+
],
86+
'no-duplicate-imports': 2,
87+
'no-empty-function': 2,
88+
'no-else-return': 2,
89+
'no-eval': 2,
90+
'no-extend-native': 2,
91+
'no-extra-bind': 2,
92+
'no-global-assign': 2,
93+
'no-implicit-globals': 2,
94+
'no-implied-eval': 2,
95+
'no-lonely-if': 2,
96+
'no-loop-func': 2,
97+
'no-new-func': 2,
98+
'no-new-wrappers': 2,
99+
'no-proto': 2,
100+
'no-script-url': 2,
101+
'no-self-compare': 2,
102+
'no-throw-literal': 2,
103+
'no-unmodified-loop-condition': 2,
104+
'no-unneeded-ternary': [
105+
2,
106+
{
107+
defaultAssignment: false,
108+
},
109+
],
110+
'no-unsafe-negation': 2,
111+
'no-unused-expressions': 'off',
112+
'no-use-before-define': [2, 'nofunc'],
113+
'no-useless-call': 2,
114+
'no-useless-computed-key': 2,
115+
'no-useless-concat': 2,
116+
'no-useless-constructor': 2,
117+
'no-useless-rename': 2,
118+
'no-var': 2,
119+
'no-with': 2,
120+
'object-shorthand': 2,
121+
'operator-assignment': 2,
122+
'prefer-arrow-callback': 2,
123+
'prefer-const': 2,
124+
'prefer-rest-params': 2,
125+
'prefer-spread': 2,
126+
'import/no-unresolved': 2,
127+
'eslint-comments/no-unlimited-disable': 0,
128+
'eslint-comments/no-unused-disable': 0,
129+
'react-native/no-color-literals': 2,
130+
'react-native/no-inline-styles': 2,
131+
'react-native/no-unused-styles': 0,
132+
'react-native/split-platform-components': 2,
133+
'react/jsx-boolean-value': 2,
134+
'react/jsx-key': 1,
135+
'react/jsx-no-bind': 0,
136+
'react/jsx-pascal-case': 2,
137+
'react/jsx-wrap-multilines': 2,
138+
'react/no-danger': 2,
139+
'react/no-did-update-set-state': 2,
140+
'react/no-find-dom-node': 2,
141+
'react/no-multi-comp': [
142+
2,
143+
{
144+
ignoreStateless: true,
145+
},
146+
],
147+
'react/no-render-return-value': 2,
148+
'react/no-string-refs': 2,
149+
'react/no-unused-prop-types': 2,
150+
'react/prefer-es6-class': 2,
151+
radix: 0,
152+
},
144153
};

.prettierignore

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
/android/app/src/main/assets/InpageBridgeWeb3.js
22
/app/core/InpageBridgeWeb3.js
3+
/app/util/blockies.js
34
__snapshots__
45
android
56
coverage
67
ios
7-
node_modules
8-
package-lock.json
9-
package.json
10-
app/util/blockies.js
11-
/shim.js
12-
babel.config.js
13-
metro.config.js
148
jest.preprocessor.js
15-
scripts/metamask-bot-build-announce.js
9+
node_modules
1610
CHANGELOG.md
1711
# Ignore auto generated file used for react-native-storybook-loader
1812
/storybook/storyLoader.js

.prettierrc.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// All of these are defaults except singleQuote, but we specify them
2+
// for explicitness
3+
module.exports = {
4+
quoteProps: 'as-needed',
5+
singleQuote: true,
6+
tabWidth: 2,
7+
trailingComma: 'all',
8+
};

.vscode/settings.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"yaml.schemas": {
3-
"file:///Users/bruno/.vscode/extensions/gizmos.docs-yaml-0.1.5/schemas/toc.schema.json": "/toc\\.yml/i"
4-
}
2+
"yaml.schemas": {
3+
"file:///Users/bruno/.vscode/extensions/gizmos.docs-yaml-0.1.5/schemas/toc.schema.json": "/toc\\.yml/i"
4+
}
55
}

0 commit comments

Comments
 (0)