Comments (8)
👍 (I want to help but also not a lot of time :/ )
from eslint-config-hapi.
Added a PR #32 - some notes:
The main changes here are
- Update tests to check for new message format (using single instead of double quotes)
no-arrow-condition
rule was removed. In order to check forif ((foo) => 1) {
you have to useno-constant-condition
instead, which also checks forif (true) {
, etcspace-after-keywords
has been removed.keyword-spacing
is used in its place.keyword-spacing
is a more far reaching rule and includes spaces before keywords as well. In this PRkeyword-spacing
is on, but we can configure this rule to require spaces after and disallow spaces before keywords. It doesn't look like this can be configured to require spaces after and not care about spaces before. I'm not sure if this is important.
from eslint-config-hapi.
Closed in bd415cb
from eslint-config-hapi.
I just updated to v9. I know this doesn't properly fit in hapi's domain but I wanted to leave this here, fwiw.
My hapi project uses ES6 modules in the client-side code. With the new space-after-keywords
rule, things like
import { Component } from 'react';
import * as actions from './actions';
don't lint for spaces around the from
and as
. I have had to now override the rule in my project as:
"keyword-spacing": [2, { "after": true }]
which then doesn't care about spaces before keywords. Perhaps it would be good to leave out the "before": false
rule from this plugin itself as it could potentially cause similar such issues.
from eslint-config-hapi.
This is a really annoying situation. In older versions of ESLint we used space-after-keywords
, but did NOT use space-before-keywords
(in accordance with the hapi style guide). Now that we have to use keyword-spacing
, my understanding (someone correct me if I'm wrong on all of this) is that the before
setting is either true
or false
, and that there is no option to just ignore. Your proposal of leaving out before: false
actually means making it before: true
. I would be OK with doing this if we can prove that it doesn't create any new linting errors for code that adheres to the style guide.
from eslint-config-hapi.
OK, I've tested a few hapi modules and having before: true
seems fine. I'll take a PR for it.
from eslint-config-hapi.
You're right, rewriting the above rule as follows clarifies the intent:
"keyword-spacing": [2, { "before": true }] // by default, `after` is true, `before` is false
As for whether this won't break existing code, space-before-keywords
used to default to always
, which to me looks equivalent to the new "before": true
. I think we should be fine here.
edit: oops, you beat me to it :) PR on the way.
from eslint-config-hapi.
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
from eslint-config-hapi.
Related Issues (20)
- Drop support for everything but Node 4 and 6 HOT 1
- Add a .npmignore file HOT 1
- Update dependencies HOT 1
- Track deprecated rules HOT 1
- Catch undeclared variables HOT 5
- validation aware eslint-config HOT 2
- Warning message during eslint-config-hapi with yarn HOT 5
- Why require-await? HOT 6
- Why no dangling commas? HOT 2
- Eslint 5 support HOT 2
- Change module namespace HOT 1
- eslint 6 support HOT 1
- Action required: Greenkeeper could not be activated 🚨 HOT 1
- Add rule: no-dupe-keys HOT 3
- Missing API file
- Rule request: key-spacing
- Update ES version
- Drop node 8 and 10
- Fix es env
- Cleanup
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-config-hapi.