-
Notifications
You must be signed in to change notification settings - Fork 45
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
Extend eslint-rules #986
Extend eslint-rules #986
Conversation
Added more eslint-rules like described in [this issue](elan-ev#985). This resolves elan-ev#985 Haven't added `"array-bracket-spacing": ["error", "always"]` yet. Every useState declaration will look like this: `const [ state, setState ] = useState()` not quite sure, if I like how it looks. I think I will wait for feedback for this rule.
Should I add comments to each rule that briefly explain what the rules are for? (like in the linked issue) |
One line was over max-length (120) and missed space between brackets.
Since ESLint has a good documentation, and it's really easy to look up the rules (if you don't already understand them from their name alone), I don't think it is necessary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! That makes stuff way easier.
I realize this is already merged, but I thought my comments might be useful anyway.
"eol-last": ["error", "always"], | ||
"func-call-spacing": ["error", "never"], | ||
"indent": ["error", 2, { "SwitchCase": 1, "MemberExpression": "off" }], | ||
"jsx-quotes": ["error", "prefer-single"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just checked and Studio used more double quotes before. Enabling this rule causes 77 errors. Enabling prefer-double
only causes 23 errors. Tobira uses double quotes; the editor seems to use double quotes as well. It's also closer to HTML (which JSX wants to mimic). So I'd have preferred to use double quotes.
Should we still change this or just keep it as is now?
@@ -136,7 +136,7 @@ export class SettingsManager { | |||
// the value at the end. | |||
let obj = rawUrlSettings; | |||
const segments = key.split('.'); | |||
segments.slice(0, -1).forEach((segment) => { | |||
segments.slice(0, -1).forEach( segment => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The space left of segment
doesn't belong here, right?
} | ||
}} | ||
}} // eslint-disable-line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hu, why is that needed?
Added more eslint-rules like described here.
This resolves #985
Haven't added
"array-bracket-spacing": ["error", "always"]
yet. Every useState declaration will look like this:const [ state, setState ] = useState()
not quite sure, if I like how it looks. I think I will wait for feedback for this rule.