Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add eslint/ for @babel/eslint-* packages #10705

Merged
merged 569 commits into from Nov 14, 2019
Merged

Conversation

kaicataldo
Copy link
Member

@kaicataldo kaicataldo commented Nov 14, 2019

Q                       A
Fixed Issues? No issue!
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature? I think this would be considered a minor?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes? Only the ones in the packages themselves
License MIT

This is the result of running the following commands:

$ ./node_modules/.bin/lerna import ~/Code/babel-eslint-config-internal --dest=eslint --preserve-commit --flatten
$ ./node_modules/.bin/lerna import ~/Code/babel-eslint-parser --dest=eslint --preserve-commit --flatten
$ ./node_modules/.bin/lerna import ~/Code/babel-eslint-plugin --dest=eslint --preserve-commit --flatten
$ ./node_modules/.bin/lerna import ~/Code/babel-eslint-plugin-development/ --dest=eslint --preserve-commit --flatten

This PR uses lerna import to bring in all the ESLint-related packages and adds them to a top-level eslint/ directory.

I didn't change the package names yet or update the versions. Is it okay to follow up with that? Figured it would be nice to bring them in as they are now and update them afterwards for posterity.

jquense and others added 30 commits June 19, 2015 00:04
…decorators

Added support for decorators in the new-cap rule.
…opedvar_export

Added support for experimental export types
…brackets_export

Added support for experimental exports in the `space-in-brackets` rule.
…urlyspacing_export

Added support for experimental exports in the `object-curly-spacing` rule
Add support for async functions in arrow-parens
Support trailing commas in import and export statements. Fixes babel/eslint-plugin-babel#21
…ue36

Fix: `object-curly-spacing` had been crashing on an empty object patt…
…ue37

Update: Implement auto fix for object-curly-spacing (fixes babel/eslint-plugin-babel#37)
…ue35

Fix: array-bracket-spacing for destructuring typed parameter (fixes babel/eslint-plugin-babel#35)
…type-annotations

Add type annotations to arrow-parens "as-needed"
dependabot bot and others added 11 commits July 12, 2019 20:20
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.4 to 4.17.14.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.4...4.17.14)

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.5 to 4.17.14.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.5...4.17.14)

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.4.0 to 1.4.2.
- [Release notes](https://github.com/mysticatea/eslint-utils/releases)
- [Commits](mysticatea/eslint-utils@v1.4.0...v1.4.2)

Signed-off-by: dependabot[bot] <support@github.com>
@kaicataldo kaicataldo changed the title Import babel eslint Add eslint/ for @babel/eslint-* packages Nov 14, 2019
@kaicataldo
Copy link
Member Author

Ah, one tricky thing. ESLint dropped support for Node <8, and we're running tests in Node 6 here.

@JLHwung
Copy link
Contributor

JLHwung commented Nov 14, 2019

We can extract the jest configuration into jest.config.js and ignore the test files begin with @babel/eslint-* when process.version is less than 8.

@nicolo-ribaudo
Copy link
Member

I'd prefer not to modify anything in this PR (just import the packages), and then modify things in a separate PR

@JLHwung
Copy link
Contributor

JLHwung commented Nov 14, 2019

Yep we can hold it for it depends on other PRs.

@kaicataldo
Copy link
Member Author

Is it okay to have CI failing until I can follow up? Looks like we'll have to do this in a few steps:

  1. Have ESLint ignore the new directories
  2. Remove custom linting config, testing, etc. configuration from the individual packages
  3. Fix Linting errors
  4. Disable testing @babel/eslint-parser related packages in Node <8

One thing I'm a bit confused about is that it looks like the repo is already on ESLint v6, which doesn't support Node 6.

@kaicataldo
Copy link
Member Author

I think we can fix CI by updating the ESLint config in this PR, which seems like the best thing to do to me.

@kaicataldo
Copy link
Member Author

Ah, I see what it is - it's currently 6.0.1, which doesn't use any syntax that would throw in Node 6. This will stop working if the repo upgrades to the latest version, though, as we now have syntax that would be unsupported (see eslint/eslint#12407).

@kaicataldo
Copy link
Member Author

Are there plans to drop support for Node 6 (and 11) now that they're not longer officially supported?

@JLHwung
Copy link
Contributor

JLHwung commented Nov 14, 2019

IIRC, Nodejs 11 has been dropped from CI. We will drop node 6 and 8 in babel 8 after node 8 reaches EOL, which is the end of this year.

@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Nov 14, 2019

Ok I think that it worked:

git filter-branch -f --msg-filter "node $PWD/../rewrite-commit-msg.js" master..import-babel-eslint
// ../rewrite-commit-msg.js

"use strict";
const fs = require("fs");
const cp = require("child_process");

let msg = fs.readFileSync("/dev/stdin", "utf8");

const folderToRepo = {
  "babel-eslint-config-internal": "eslint-config-babel",
  "babel-eslint-parser": "babel-eslint",
  "babel-eslint-plugin": "eslint-plugin-babel",
  "babel-eslint-plugin-development": "eslint-plugin-babel-plugin"
};

let file = cp
  .execSync(
    `git diff-tree --no-commit-id --name-only -r ${process.env.GIT_COMMIT}`,
    { encoding: "utf8" }
  )
  .trim()
  .split("\n")[0];

if (!file.startsWith("eslint/")) {
  return msg;
}
const repo = folderToRepo[file.split("/")[1]];
if (!repo) {
  throw new Error(`Folder does not map to a known repo: ${file} ${process.env.GIT_COMMIT}`);
}

process.stdout.write(msg.replace(/(?<!\w)#(\d+)/g, `babel/${repo}#$1`));

Old branch: https://github.com/nicolo-ribaudo/babel/commits/import-babel-eslint-backup
New branch: https://github.com/babel/babel/commits/import-babel-eslint

@nicolo-ribaudo nicolo-ribaudo merged commit ec18c30 into master Nov 14, 2019
@nicolo-ribaudo nicolo-ribaudo deleted the import-babel-eslint branch November 14, 2019 19:51
@nicolo-ribaudo nicolo-ribaudo added the PR: Internal 🏠 A type of pull request used for our changelog categories label Nov 14, 2019
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Feb 13, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Feb 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Internal 🏠 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet