Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

Commit 53d2a63

Browse files
mrkevfacebook-github-bot
authored andcommitted
Upgrades ESLint and related plugins/configs. (#2231)
Summary: This fixes some security issues reported by GitHub. There are still warnings on the lint, but no errors. I had to make some changes. Most notably: ## `.eslintrc.js` Changed the value of `rules` because it was required by the new `eslint-plugin-prettier`. See prettier/eslint-plugin-prettier@478c7e5 ## `/src` Changed some lints referencing `fb-www/`. ESLint 6 reports errors on rules that aren't found (see: eslint/eslint@2d32a9e). For some reason `fb-www` rules are not found. Changing the disables to be `/* eslint-disable-next-line */` makes them valid both the open source config and Facebook's internal config. Pull Request resolved: #2231 Reviewed By: claudiopro Differential Revision: D18206971 Pulled By: mrkev fbshipit-source-id: 55ca3e8a24c61250dd7cd01220ed55c73a140b9d
1 parent 5dd99d3 commit 53d2a63

File tree

6 files changed

+360
-165
lines changed

6 files changed

+360
-165
lines changed

.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = {
1414
'prettier/standard',
1515
],
1616
rules: {
17-
'prettier/prettier': ['error', 'fb'],
17+
'prettier/prettier': ['error'],
1818
},
1919
plugins: ['prettier'],
2020
overrides: [

package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@
5252
"del": "^2.2.0",
5353
"envify": "^3.4.0",
5454
"es6-shim": "^0.34.4",
55-
"eslint": "^5.16.0",
56-
"eslint-config-fbjs": "^2.0.0",
57-
"eslint-config-prettier": "^2.6.0",
58-
"eslint-plugin-babel": "^4.1.1",
59-
"eslint-plugin-flowtype": "^2.17.1",
60-
"eslint-plugin-jsx-a11y": "^6.0.2",
61-
"eslint-plugin-prettier": "^2.3.1",
62-
"eslint-plugin-react": "^7.3.0",
63-
"eslint-plugin-relay": "^0.0.8",
55+
"eslint": "^6.6.0",
56+
"eslint-config-fbjs": "^3.1.1",
57+
"eslint-config-prettier": "^6.5.0",
58+
"eslint-plugin-babel": "^5.3.0",
59+
"eslint-plugin-flowtype": "^4.3.0",
60+
"eslint-plugin-jsx-a11y": "^6.2.3",
61+
"eslint-plugin-prettier": "^3.1.1",
62+
"eslint-plugin-react": "^7.16.0",
63+
"eslint-plugin-relay": "^1.3.12",
6464
"fbjs-scripts": "^1.1.0",
6565
"flow-bin": "^0.92.0",
6666
"gulp": "^4.0.0",

src/component/selection/getUpdatedSelectionState.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ function getUpdatedSelectionState(
2828
const selection: SelectionState = nullthrows(editorState.getSelection());
2929
if (__DEV__) {
3030
if (!anchorKey || !focusKey) {
31-
/* eslint-disable fb-www/no-console */
31+
/* eslint-disable-next-line */
3232
console.warn('Invalid selection state.', arguments, editorState.toJS());
33-
/* eslint-enable fb-www/no-console */
3433
return selection;
3534
}
3635
}
@@ -50,9 +49,8 @@ function getUpdatedSelectionState(
5049
if (!anchorLeaf || !focusLeaf) {
5150
// If we cannot make sense of the updated selection state, stick to the current one.
5251
if (__DEV__) {
53-
/* eslint-disable fb-www/no-console */
52+
/* eslint-disable-next-line */
5453
console.warn('Invalid selection state.', arguments, editorState.toJS());
55-
/* eslint-enable fb-www/no-console */
5654
}
5755
return selection;
5856
}

src/model/modifier/__tests__/AtomicBlockUtils-test.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ const CHARACTER = ' ';
3333

3434
const getInvariantViolation = msg => {
3535
try {
36-
/* eslint-disable fb-www/sprintf-like-args */
36+
/* eslint-disable-next-line */
3737
invariant(false, msg);
38-
/* eslint-enable fb-www/sprintf-like-args */
3938
} catch (e) {
4039
return e;
4140
}

src/model/transaction/__tests__/insertFragmentIntoContentState-test.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ const initialBlock = contentState.getBlockMap().first();
3939

4040
const getInvariantViolation = msg => {
4141
try {
42-
/* eslint-disable fb-www/sprintf-like-args */
42+
/* eslint-disable-next-line */
4343
invariant(false, msg);
44-
/* eslint-enable fb-www/sprintf-like-args */
4544
} catch (e) {
4645
return e;
4746
}

0 commit comments

Comments
 (0)