Skip to content
This repository was archived by the owner on Mar 7, 2019. It is now read-only.

Commit 670a1d4

Browse files
Update formatting, comments, other minor stuff 😎
1 parent 2ce81c3 commit 670a1d4

File tree

4 files changed

+26
-24
lines changed

4 files changed

+26
-24
lines changed

‎coding-styles/react.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ module.exports = {
1919

2020
// Disallow spaces inside of curly braces in JSX attributes
2121
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md
22-
'react/jsx-curly-spacing': [1, 'never', { allowMultiline: true }],
22+
'react/jsx-curly-spacing': [1, 'never', {
23+
allowMultiline: true
24+
}],
2325

2426
// Enforce or disallow spaces around equal signs in JSX attributes
2527
// This rule will enforce consistency of spacing around equal signs in JSX attributes, by

‎environments/react/best-practices.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ module.exports = {
2121

2222
// Restrict file extensions that may contain JSX
2323
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
24-
'react/jsx-filename-extension': [1, { extensions: ['.jsx'] }],
24+
'react/jsx-filename-extension': [1, {
25+
extensions: ['.jsx']
26+
}],
2527

2628
// Detect missing key prop
2729
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-key.md
@@ -50,7 +52,7 @@ module.exports = {
5052
}],
5153

5254
// Disallow Use of console
53-
// Turned off for React apps
55+
// Turned off for React apps, console is quite useful in browsers
5456
'no-console': 0
5557
}
5658
}

‎environments/react/known-errors.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ module.exports = {
1717
'react/jsx-no-bind': [2, {
1818
ignoreRefs: true,
1919
allowArrowFunctions: true,
20-
allowBind: false,
20+
allowBind: false
2121
}],
2222

2323
// Prevent duplicate properties in JSX
2424
// Creating JSX elements with duplicate props can cause unexpected behavior in your application.
2525
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md
26-
'react/jsx-no-duplicate-props': [2, { ignoreCase: true }],
26+
'react/jsx-no-duplicate-props': [2, {
27+
ignoreCase: true
28+
}],
2729

2830
// Prevent usage of unsafe target='_blank'
2931
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
@@ -79,7 +81,9 @@ module.exports = {
7981

8082
// Prevent multiple component definitions per file
8183
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md
82-
'react/no-multi-comp': [2, { ignoreStateless: true }],
84+
'react/no-multi-comp': [2, {
85+
ignoreStateless: true
86+
}],
8387

8488
// Prevent usage of the return value of React.render
8589
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-render-return-value.md
@@ -100,7 +104,7 @@ module.exports = {
100104
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-prop-types.md
101105
'react/no-unused-prop-types': [2, {
102106
customValidators: [],
103-
skipShapeProps: false,
107+
skipShapeProps: false
104108
}],
105109

106110
// Enforce ES6 class for React Components
@@ -112,7 +116,10 @@ module.exports = {
112116
// warn other developers if they make a mistake while reusing the component with improper data
113117
// type.
114118
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md
115-
'react/prop-types': [2, { ignore: [], customValidators: [] }],
119+
'react/prop-types': [2, {
120+
ignore: [],
121+
customValidators: []
122+
}],
116123

117124
// Prevent missing React when using JSX
118125
// When using JSX, <a /> expands to React.createElement("a"). Therefore the React variable must

‎unused.js

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -103,37 +103,28 @@ module.exports = {
103103
// This rule checks all JSX components and verifies that no forbidden propsTypes are used.
104104
'react/forbid-prop-types': 0,
105105

106+
// eslint-plugin-react
107+
106108
// Prevent usage of setState
107109
'react/no-set-state': 0,
108110

109-
// Limit maximum of props on a single line in JSX
110-
'react/max-props-per-line': 0,
111-
112111
// Prevent usage of unwrapped JSX strings
113112
'react/jsx-no-literals': 0,
114113

115114
// Enforce props alphabetical sorting
116-
'react/jsx-sort-props': [0, {
117-
ignoreCase: true,
118-
callbacksLast: false,
119-
shorthandFirst: false,
120-
shorthandLast: false,
121-
}],
115+
'react/jsx-sort-props': 0,
122116

123117
// Limit maximum of props on a single line in JSX
124-
'react/jsx-max-props-per-line': [0, { maximum: 1 }],
118+
'react/jsx-max-props-per-line': 0,
125119

126120
// Enforce event handler naming conventions in JSX
127-
'react/jsx-handler-names': [0, {
128-
eventHandlerPrefix: 'handle',
129-
eventHandlerPropPrefix: 'on',
130-
}],
121+
'react/jsx-handler-names': 0,
131122

132123
// Prevent missing displayName in a React component definition
133-
'react/display-name': [0, { ignoreTranspilerName: false }],
124+
'react/display-name': 0,
134125

135126
// Forbid certain props on Components
136-
'react/forbid-component-props': [0, { forbid: [] }],
127+
'react/forbid-component-props': 0,
137128

138129
// Enforce React components to have a shouldComponentUpdate method
139130
'react/require-optimization': 0

0 commit comments

Comments
 (0)