Skip to content

Commit

Permalink
feat: update eslint deps in eslint configs (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradzacher committed Jul 11, 2022
1 parent 67f2852 commit 549c572
Show file tree
Hide file tree
Showing 15 changed files with 1,260 additions and 1,157 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
parser: 'babel-eslint',
parser: 'hermes-eslint',
extends: [
require.resolve('./packages/eslint-config-fbjs'),
],
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"private": true,
"license": "MIT",
"devDependencies": {
"babel-eslint": "^10.0.1",
"eslint": "^5.1.0",
"hermes-eslint": "^0.8.0",
"eslint": "^8.19.0",
"eslint-config-fbjs": "0.0.0",
"eslint-plugin-babel": "^5.2.1",
"eslint-plugin-flowtype": "^2.43.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.6.1",
"eslint-plugin-ft-flow": "^2.0.1",
"eslint-plugin-jsx-a11y": "^6.6.0",
"eslint-plugin-react": "^7.30.1",
"prettier": "^1.16.4"
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/babel-preset-fbjs/plugins/auto-importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ module.exports = function autoImporter(babel) {
}

return {
pre: function() {
pre() {
// Cache per file to avoid calling `scope.hasBinding` several
// times for the same module, which has already been auto-imported.
this.autoImported = {};
},

visitor: {
ReferencedIdentifier: function(path) {
ReferencedIdentifier(path) {
const node = path.node;
const scope = path.scope;

Expand Down
4 changes: 2 additions & 2 deletions packages/babel-preset-fbjs/plugins/dev-expression.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = function(babel) {
return {
visitor: {
Identifier: {
enter: function(path) {
enter(path) {
// Do nothing when testing
if (process.env.NODE_ENV === 'test') {
return;
Expand All @@ -41,7 +41,7 @@ module.exports = function(babel) {
},
},
CallExpression: {
exit: function(path) {
exit(path) {
var node = path.node;
// Do nothing when testing
if (process.env.NODE_ENV === 'test') {
Expand Down
6 changes: 3 additions & 3 deletions packages/babel-preset-fbjs/plugins/object-assign.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ module.exports = function autoImporter(babel) {
}

return {
pre: function() {
pre() {
// map from module to generated identifier
this.id = null;
},

visitor: {
CallExpression: function(path, file) {
CallExpression(path, file) {
if (path.get('callee').matchesPattern('Object.assign')) {
// generate identifier and require if it hasn't been already
var id = getAssignIdent(path, file, this);
path.node.callee = id;
}
},

MemberExpression: function(path, file) {
MemberExpression(path, file) {
if (path.matchesPattern('Object.assign')) {
var id = getAssignIdent(path, file, this);
path.replaceWith(id);
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-fb-strict/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports = Object.assign({}, fbjsConfig, {
'comma-style': [2, 'last'],
'computed-property-spacing': [2, 'never'],
'eol-last': [2],
'flowtype/object-type-delimiter': [2, 'comma'],
'ft-flow/object-type-delimiter': [2, 'comma'],
indent: [0],
'max-len': [
2,
Expand Down
14 changes: 7 additions & 7 deletions packages/eslint-config-fb-strict/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"eslint-config-fbjs": "^3.1.1"
"eslint-config-fbjs": "^4.0.0"
},
"peerDependencies": {
"babel-eslint": "^8.0.0 || ^9.0.0 || ^10.0.0",
"eslint": "^5.1.0 || ^6.0.0",
"eslint-plugin-babel": "^4.1.1 || ^5.2.1",
"eslint-plugin-flowtype": "^2.43.0 || ^3.0.0 || ^4.0.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.6.1"
"hermes-eslint": ">=0.8.0",
"eslint": "^8.0.0",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-ft-flow": "^2.0.1",
"eslint-plugin-jsx-a11y": "^6.6.0",
"eslint-plugin-react": "^7.30.1"
}
}
48 changes: 24 additions & 24 deletions packages/eslint-config-fbjs-opensource/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const maxLenIgnorePattern = require('fbjs-eslint-utils/shared').maxLenIgnorePatt

module.exports = {

parser: 'babel-eslint',
parser: '@babel/eslint-parser',

parserOptions: {
ecmaVersion: 7,
Expand Down Expand Up @@ -298,28 +298,28 @@ module.exports = {
'babel/no-invalid-this': 0,
'babel/no-await-in-loop': 0, // deprecated; now using 'no-await-in-loop' from eslint core

// flowtype (https://github.com/gajus/eslint-plugin-flowtype)
'flowtype/boolean-style': 1,
'flowtype/define-flow-type': 1,
'flowtype/delimiter-dangle': [1, 'always-multiline'],
'flowtype/generic-spacing': 1,
'flowtype/no-dupe-keys': 1,
'flowtype/no-primitive-constructor-types': 1,
'flowtype/no-weak-types': 1,
'flowtype/object-type-delimiter': 1,
'flowtype/require-parameter-type': 0,
'flowtype/require-return-type': 0,
'flowtype/require-valid-file-annotation': 0,
'flowtype/require-variable-type': 0,
'flowtype/semi': 1,
'flowtype/sort-keys': 0,
'flowtype/space-after-type-colon': [1, 'always'],
'flowtype/space-before-generic-bracket': 1,
'flowtype/space-before-type-colon': 1,
'flowtype/type-id-match': 0,
'flowtype/union-intersection-spacing': 1,
'flowtype/use-flow-type': 1,
'flowtype/valid-syntax': 0,
// ft-flow (https://github.com/flow-typed/eslint-plugin-ft-flow)
'ft-flow/boolean-style': 1,
'ft-flow/define-flow-type': 1,
'ft-flow/delimiter-dangle': [1, 'always-multiline'],
'ft-flow/generic-spacing': 1,
'ft-flow/no-dupe-keys': 1,
'ft-flow/no-primitive-constructor-types': 1,
'ft-flow/no-weak-types': 1,
'ft-flow/object-type-delimiter': 1,
'ft-flow/require-parameter-type': 0,
'ft-flow/require-return-type': 0,
'ft-flow/require-valid-file-annotation': 0,
'ft-flow/require-variable-type': 0,
'ft-flow/semi': 1,
'ft-flow/sort-keys': 0,
'ft-flow/space-after-type-colon': [1, 'always'],
'ft-flow/space-before-generic-bracket': 1,
'ft-flow/space-before-type-colon': 1,
'ft-flow/type-id-match': 0,
'ft-flow/union-intersection-spacing': 1,
'ft-flow/use-flow-type': 1,
'ft-flow/valid-syntax': 0,

// Jasmine (https://github.com/tlvince/eslint-plugin-jasmine)
'jasmine/missing-expect': 0,
Expand Down Expand Up @@ -394,7 +394,7 @@ module.exports = {

plugins: [
'babel',
'flowtype',
'ft-flow',
'jasmine',
'prefer-object-spread',
'react',
Expand Down
10 changes: 5 additions & 5 deletions packages/eslint-config-fbjs-opensource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
"warning.js"
],
"dependencies": {
"babel-eslint": "^10.0.1",
"eslint-plugin-babel": "^5.2.1",
"eslint-plugin-flowtype": "^2.43.0",
"@babel/eslint-parser": "^7.18.2",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-ft-flow": "^2.0.1",
"eslint-plugin-jasmine": "^2.10.1",
"eslint-plugin-prefer-object-spread": "^1.2.1",
"eslint-plugin-react": "^7.6.1",
"eslint-plugin-react": "^7.30.1",
"fbjs-eslint-utils": "^1.0.0"
},
"peerDependencies": {
"eslint": "^5.1.0 || ^6.0.0"
"eslint": "^8.0.0"
}
}
Loading

0 comments on commit 549c572

Please sign in to comment.