eslint-config-airbnb and eslint-config-airbnb-base do not yet support eslint v4.
If it is easy/possible to support both v3 and v4, we will release a non-major bump of both packages that does so, before releasing a major bump that only supports v4.
This will likely take a few weeks at a minimum.
Please do not file additional issues and do not file pull requests attempting to add support - please, instead, continue to use eslint v3 until such time as our configs support v4.
Peer Dep eslint combined v3 and v4 support released:
Any updates to this?
@Geczy I've kept the OP updated; if there's updates, you'd see them here.
Since there are no updates posted, no, there are no updates. Please be patient - the OP said "a few weeks at minimum" and it's not yet been 3.
It would be useful to post somewhere prominent on what would be recommended for new projects and the best way to stay on the 3x branch for eslint.
yarn add eslint@3 for yarn users would go a long way to avoid setup hassles.
Really would like this feature. The ability to use overrides would be awesome!
"overrides": [
{
"files": ["src/**/__tests__/*.js"],
"env": {
"jest": true
}
}
]
@MFry i believe yarn has --peer, such that yarn add eslint-config-airbnb --peer should just work? If not, I'd file a bug on yarn. Note that the existing instructions have no setup hassles with npm.
@EloB i'd strongly discourage you from colocating tests; but I agree that if you're doing so, it's a useful feature to be able to configure eslint with globs.
@ljharb would you be willing to expand on the reason for discouraging test colocation?
i used to be more on the side of separating, and still do at this point. however, i've mostly come around to the idea of keeping them with the source files and eslint is the last thing keeping me from doing so.
i'm interested in your specific thoughts if you'd be willing to share.
@travi that's really a topic for another thread (feel free to file one); and I have a litany of reasons. However, most of those are moot because "not all tools support glob-based configuration". eslint only added it in v4, babel doesn't, etc.
No updates since 2 weeks ago, it's now been 1 month, any news? Do you guys need help taking this on from contributors?
@ljharb npm3 removed easy install of peer dependencies and the support is not yet available in yarn.
Doing yarn add eslint-config-airbnb --peer would just install the package in your peerdependencies. :(
From NPM:
#6930 (#6565) peerDependencies no longer cause anything to be implicitly installed. Instead, npm will now warn if a packages peerDependencies are missing, but it's up to the consumer of the module (i.e. you) to ensure the peers get installed / are included in package.json as direct dependencies or devDependencies of your package.
@MFry ah, i misunderstood what --peer does for yarn. In that case, I don't have an easy solution to install the needed peer deps with yarn - but since npm 5 exists, I'm not sure why you'd need yarn :-)
I'm aware that npm 3+ no longer automatically installs peer deps; that's why the readme of both of our eslint config packages has instructions to do so.
@Geczy no, no help is needed. There's no urgency; and the update will come when it's ready.
I'm not sure why you'd need yarn
npm 5 isn't always a feasible option, particularly in enterprise environments that have specific CI build processes that depend on yarn instead of npm. If this fix depends on npm 5, it won't work for us, unfortunately.
@noahbenham If your enterprise environment chose to rely on a new, non-default package manager, that's kind of the boat you've put yourself :-/ regardless, the instructions in the package readme are for any version of npm, and don't require npm 5 - and you can always manually install the proper peer dep versions yourself, with npm or yarn, it just won't be a simple paste-able command.
For exploratory testing in the meantime, here's a couple forks:
https://github.com/arizzitano/eslint-config-airbnb
https://github.com/arizzitano/eslint-config-airbnb-base
Use at your own risk, obviously, and don't use them in production 馃拋馃徎馃尭馃寛馃槝
"risk" lol even though it's a dev dependency?
@Geczy you know that npm packages are able to run arbitrary script in post install with your user permissions, right?
馃槷
Any update on when this will be deployed? Been a little over a month now and I was just curious. Thanks for the style guide ruleset!
@ljharb I've spent enough time with NPM5 and the new package-lock to understand why people are still using Yarn. The package-lock is still broken and does not have consistent behaviour. People on our team were getting into an repeating loop of git pull, rm -rf node_modules, npm install to get things working. When NPM gets confused it will actually write changes to an existing package-lock when running npm install which just seems insane to me.
I'd love to see NPM get to the point where yarn isn't necessary for us, but so far we've had poor luck.
@ljharb Need any help on getting this out? Audit and review of new rules? Dep bumps?
+1 for a constructive comment on this.
no, no help is needed. There's no urgency; and the update will come when it's ready.
@chrisnicola same does yarn, unfortunately :/ we sometimes get a changing yarn.lock after simply calling yarn install
At the very least, I think we're waiting on a new npm release of eslint-plugin-react. They have pushed changes to master that enable eslint 4 compatibility, but haven't cut an official release yet. I installed the package as a github dependency alongside package bumps for the other deps and had some success. Here's a diff of my changes: https://github.com/airbnb/javascript/compare/master...arizzitano:ari/eslint-4
Our team has been using this forked version and it's been working just fine with eslint 4. Of course, we don't represent all use cases, and installing github dependencies carries its own risks, but it's doable. QED.
@arizzitano Are you sure? Seems like eslint-plugin-react allows eslint v4 as a peer dependency in its latest release: https://github.com/yannickcr/eslint-plugin-react/blob/v7.1.0/package.json#L38
@jdreesen yeah, I tried it with that version. In my project it logs the following:
can't resolve reference #/definitions/basicConfig from id #
can't resolve reference #/definitions/basicConfigOrBoolean from id #
Doesn't seem to block linter functionality, though.
@milesj lol can you write my feedback for me? :-p
@arizzitano that can be ignored in eslint v4.2.0+, and will be fixed in the next release of eslint-config-airbnb-base.
eslint-config-airbnb-base v11.3.0 has been released, which supports both eslint v3 and v4. When v12.0.0 is released, it will drop support for eslint v3, and enable a number of new rules added in v4.
eslint-config-airbnb is now released as v15.1.0. When v16.0.0 is released, it will drop support for eslint v3, upgrade eslint-plugin-jsx-a11y to v6 (#1482), and enable a number of new rules added in eslint v4 and eslint-plugin-jsx-a11y v6, as well as a number of semver-major outstanding PRs and TODOs.
(tweet)
@ljharb Hi, this error still occurs when extending from airbnb/legacy. Is this the intention or should it also be updated to remove the top level ecmaFeatures?
@ljharb airbnb/legacy has some issues with v4 still
Thanks, legacy is fixed in 0d938aecf20e2a6ad586e08155e177a25d12bc5e and will be released in eslint-config-airbnb-base shortly.
Hi, any updates on when the ESLint v4-exclusive versions (v12.0.0 base and v16.0.0 main) will be released? Thanks for all the awesome works!
No updates.
@ljharb is there any version of eslint-config-airbnb that includes the fix for the legacy.js file when introducing eslint v4, ie this patch https://github.com/airbnb/javascript/commit/0d938aecf20e2a6ad586e08155e177a25d12bc5e
I don't think its included in the latest 15.1.0 of eslint-config-airbnb that I can see?
It's automatically included because of the semver range on eslint-config-airbnb-base.
v16 is now released.
Most helpful comment
eslint-config-airbnb-basev11.3.0has been released, which supports both eslint v3 and v4. Whenv12.0.0is released, it will drop support for eslint v3, and enable a number of new rules added in v4.eslint-config-airbnbis now released asv15.1.0. Whenv16.0.0is released, it will drop support for eslint v3, upgrade eslint-plugin-jsx-a11y to v6 (#1482), and enable a number of new rules added in eslint v4 and eslint-plugin-jsx-a11y v6, as well as a number of semver-major outstanding PRs and TODOs.(tweet)