Skip to content
Permalink
Browse files

Update ESLint/Prettier config for eslint/* packages (#10724)

  • Loading branch information
kaicataldo authored and nicolo-ribaudo committed Nov 16, 2019
1 parent c37361b commit 401c9bbe83292a139a91f99eff3ac5ebb0c71bbc
@@ -25,6 +25,7 @@ packages/babel-standalone/babel.js
packages/babel-standalone/babel.min.js
packages/babel-parser/test/expressions

eslint/*/lib
eslint/*/node_modules
eslint/*/test
eslint/*/tests
@@ -12,7 +12,11 @@ module.exports = {
},
overrides: [
{
files: ["packages/*/src/**/*.js", "codemods/*/src/**/*.js"],
files: [
"packages/*/src/**/*.js",
"codemods/*/src/**/*.js",
"eslint/*/src/**/*.js",
],
rules: {
"@babel/development/no-undefined-identifier": "error",
"@babel/development/no-deprecated-clone": "error",
@@ -24,6 +28,7 @@ module.exports = {
files: [
"packages/*/test/**/*.js",
"codemods/*/test/**/*.js",
"eslint/*/test/**/*.js",
"packages/babel-helper-transform-fixture-test-runner/src/helpers.js",
"test/**/*.js",
],
@@ -13,10 +13,12 @@
"**/codemods/*/src/**/*.js",
"**/codemods/*/test/**/*.js",
"**/packages/*/src/**/*.js",
"**/packages/*/test/**/*.js"
"**/packages/*/test/**/*.js",
"**/eslint/*/src/**/*.js",
"**/eslint/*/test/**/*.js"
],
"parser": "babylon",
"options": {
"parser": "babel",
"trailingComma": "all"
}
}]

This file was deleted.

This file was deleted.

@@ -94,7 +94,7 @@ class Referencer extends OriginalReferencer {
// Flow super types.
this._visitTypeAnnotation(node.implements);
this._visitTypeAnnotation(
node.superTypeParameters && node.superTypeParameters.params
node.superTypeParameters && node.superTypeParameters.params,
);

// Basic.
@@ -205,7 +205,7 @@ class Referencer extends OriginalReferencer {
_createScopeVariable(node, name) {
this.currentScope().variableScope.__define(
name,
new Definition("Variable", name, node, null, null, null)
new Definition("Variable", name, node, null, null, null),
);
}

@@ -220,7 +220,7 @@ class Referencer extends OriginalReferencer {
"type-parameters",
parentScope,
node,
false
false,
);

this.scopeManager.__nestScope(scope);
@@ -9,7 +9,7 @@ const SUPPORTED_BABEL_VERSION_RANGE =
packageJson.peerDependencies["@babel/core"];
const IS_RUNNING_SUPPORTED_VERSION = semver.satisfies(
CURRENT_BABEL_VERSION,
SUPPORTED_BABEL_VERSION_RANGE
SUPPORTED_BABEL_VERSION_RANGE,
);

exports.parse = function(code, options) {
@@ -19,7 +19,7 @@ exports.parse = function(code, options) {
exports.parseForESLint = function(code, options = {}) {
if (!IS_RUNNING_SUPPORTED_VERSION) {
throw new Error(
`babel-eslint@${packageJson.version} does not support @babel/core@${CURRENT_BABEL_VERSION}. Please downgrade to babel-eslint@^10 or upgrade to @babel/core@${SUPPORTED_BABEL_VERSION_RANGE}`
`babel-eslint@${packageJson.version} does not support @babel/core@${CURRENT_BABEL_VERSION}. Please downgrade to babel-eslint@^10 or upgrade to @babel/core@${SUPPORTED_BABEL_VERSION_RANGE}`,
);
}

@@ -46,7 +46,7 @@ module.exports = function(code, options) {
if (config !== null) {
if (!config.hasFilesystemConfig()) {
throw new Error(
`No Babel config file detected for ${config.options.filename}. Either disable config file checking with requireConfigFile: false, or configure Babel so that it can find the config files.`
`No Babel config file detected for ${config.options.filename}. Either disable config file checking with requireConfigFile: false, or configure Babel so that it can find the config files.`,
);
}

@@ -7,9 +7,9 @@ module.exports = Object.assign(
{
Literal: ESLINT_VISITOR_KEYS.Literal,
MethodDefinition: ["decorators"].concat(
ESLINT_VISITOR_KEYS.MethodDefinition
ESLINT_VISITOR_KEYS.MethodDefinition,
),
Property: ["decorators"].concat(ESLINT_VISITOR_KEYS.Property),
},
BABEL_VISITOR_KEYS
BABEL_VISITOR_KEYS,
);
@@ -32,7 +32,7 @@ module.exports = {
) {
context.report(
node,
"Use path.scope.buildUndefinedNode() to create an undefined identifier directly."
"Use path.scope.buildUndefinedNode() to create an undefined identifier directly.",
);
}
},
@@ -44,7 +44,7 @@ module.exports = {
if (!returnValue.properties.some(p => p.key.name === "name")) {
context.report(
returnValue,
"This Babel plugin doesn't have a 'name' property."
"This Babel plugin doesn't have a 'name' property.",
);
}
}
@@ -6,7 +6,7 @@ const isBabelPluginFactory = require("./is-babel-plugin-factory");
// is a reference to a @babel/types export.
module.exports = function isFromBabelTypes(
origin /*: ReferenceOrigin */,
scope /*: Scope */
scope /*: Scope */,
) {
if (origin.kind === "import" && origin.source === "@babel/types") {
// imported from @babel/types

0 comments on commit 401c9bb

Please sign in to comment.
You can’t perform that action at this time.