Skip to content
This repository was archived by the owner on Aug 18, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: babel/babel-eslint
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6aa8b6f02ff83cfb14eae2432f226f113929a50f
Choose a base ref
...
head repository: babel/babel-eslint
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4bd049e06e2c7ab31053020fc662f51bf6c179e3
Choose a head ref
  • 13 commits
  • 12 files changed
  • 6 contributors

Commits on Sep 25, 2018

  1. Drop old monkeypatching behavior (#689)

    An alternative to adding a direct dep on estraverse (#685), let's just drop the old monkeypatching behavior.
    
    Closes #685, Closes #680
    existentialism authored and hzoo committed Sep 25, 2018
    Copy the full SHA
    c333bd6 View commit details
  2. Test eslint5, update peerDep (#690)

    * test against eslint 5
    * set peerDep
    hzoo authored Sep 25, 2018
    Copy the full SHA
    b400cb1 View commit details
  3. Treat type alias declarationlike function declaration (#584)

    A type alias shouldn't trigger a no-use-before-define warning just
    like a function declaration.
    
    Cyclic type dependencies are common when using flow.
    For instance: type Node<T> = { head: T; tail: Node<T> }
    
    Fixes #485
    joa authored and hzoo committed Sep 25, 2018
    Copy the full SHA
    020d012 View commit details
  4. test value should be switched

    hzoo committed Sep 25, 2018
    Copy the full SHA
    717fba7 View commit details
  5. 10.0.0

    hzoo committed Sep 25, 2018
    Copy the full SHA
    8f78e28 View commit details

Commits on Sep 27, 2018

  1. Revert #584 (#697)

    * Revert "Treat type alias declarationlike function declaration (#584)"
    
    This reverts commit 020d012.
    hzoo authored Sep 27, 2018
    Copy the full SHA
    98c1f13 View commit details
  2. 10.0.1

    hzoo committed Sep 27, 2018
    Copy the full SHA
    4cf0a21 View commit details

Commits on Jun 17, 2019

  1. Copy the full SHA
    0241b48 View commit details
  2. 10.0.2

    hzoo committed Jun 17, 2019
    Copy the full SHA
    48f6d78 View commit details

Commits on Aug 25, 2019

  1. Copy the full SHA
    354953d View commit details
  2. 10.0.3

    hzoo committed Aug 25, 2019
    Copy the full SHA
    183d13e View commit details

Commits on Feb 25, 2020

  1. Update Babel to ^7.7.0 and enable Flow enums parsing (#812)

    * Update Babel to ^7.7.0 and enable Flow enums parsing
    
    * Update comment about Espree Flow enums support
    
    * Add EnumDeclaration to scope analyzer
    
    * Add test for unused enum
    gkz authored Feb 25, 2020
    Copy the full SHA
    2c754a8 View commit details

Commits on Feb 26, 2020

  1. 10.1.0

    Kai Cataldo committed Feb 26, 2020
    Copy the full SHA
    4bd049e View commit details
Showing with 316 additions and 697 deletions.
  1. +12 −9 lib/analyze-scope.js
  2. +1 −4 lib/index.js
  3. +0 −9 lib/parse-with-patch.js
  4. +1 −1 lib/parse.js
  5. +0 −374 lib/patch-eslint-scope.js
  6. +9 −0 lib/require-from-eslint.js
  7. +14 −12 package.json
  8. +12 −2 test/babel-eslint.js
  9. +0 −12 test/fixtures/use-eslint-old.js
  10. +1 −0 test/integration.js
  11. +18 −0 test/non-regression.js
  12. +248 −274 yarn.lock
21 changes: 12 additions & 9 deletions lib/analyze-scope.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
"use strict";

const t = require("@babel/types");
const escope = require("eslint-scope");
const Definition = require("eslint-scope/lib/definition").Definition;
const OriginalPatternVisitor = require("eslint-scope/lib/pattern-visitor");
const OriginalReferencer = require("eslint-scope/lib/referencer");
const requireFromESLint = require("./require-from-eslint");

const escope = requireFromESLint("eslint-scope");
const Definition = requireFromESLint("eslint-scope/lib/definition").Definition;
const OriginalPatternVisitor = requireFromESLint(
"eslint-scope/lib/pattern-visitor"
);
const OriginalReferencer = requireFromESLint("eslint-scope/lib/referencer");
const fallback = require("eslint-visitor-keys").getKeys;
const childVisitorKeys = require("./visitor-keys");

@@ -145,6 +149,10 @@ class Referencer extends OriginalReferencer {
}
}

EnumDeclaration(node) {
this._createScopeVariable(node, node.id);
}

TypeAlias(node) {
this._createScopeVariable(node, node.id);

@@ -327,11 +335,6 @@ module.exports = function(ast, parserOptions) {
fallback,
};

if (OriginalReferencer._babelEslintPatched) {
require("./patch-eslint-scope")(parserOptions);
return escope.analyze(ast, options);
}

options.childVisitorKeys = childVisitorKeys;

const scopeManager = new escope.ScopeManager(options);
5 changes: 1 addition & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -11,10 +11,7 @@ exports.parseForESLint = function(code, options) {
options.allowImportExportEverywhere =
options.allowImportExportEverywhere || false;

if (options.eslintVisitorKeys && options.eslintScopeManager) {
return require("./parse-with-scope")(code, options);
}
return { ast: require("./parse-with-patch")(code, options) };
return require("./parse-with-scope")(code, options);
};

exports.parseNoPatch = function(code, options) {
9 changes: 0 additions & 9 deletions lib/parse-with-patch.js

This file was deleted.

2 changes: 1 addition & 1 deletion lib/parse.js
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ module.exports = function(code, options) {
ranges: true,
tokens: true,
plugins: [
["flow", { all: true }],
["flow", { all: true, enums: true }],
"jsx",
"estree",
"asyncFunctions",
Loading