-
-
Notifications
You must be signed in to change notification settings - Fork 68
Use eslint #196
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
Closed
Use eslint #196
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2682854
use eslint
saschanaz a38b3d3
linebreak should be managed by git
saschanaz 11e5737
split lint script
saschanaz ac5d9e3
fix lint
saschanaz a28c5da
Merge branch 'develop' into eslint
saschanaz 4da9dba
Merge branch 'develop' into eslint
saschanaz f78a05f
fix test
saschanaz 636947f
turn semi on
saschanaz 671946d
prefer const
saschanaz 68f7fb3
Merge branch 'develop' into eslint
saschanaz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,316 @@ | ||
| { | ||
| "env": { | ||
| "browser": true, | ||
| "commonjs": true, | ||
| "amd": true, | ||
| "es6": true, | ||
| "node": true, | ||
| "mocha": true | ||
| }, | ||
| "extends": "eslint:recommended", | ||
| "rules": { | ||
| "accessor-pairs": "error", | ||
| "array-bracket-newline": "error", | ||
| "array-bracket-spacing": [ | ||
| "error", | ||
| "never" | ||
| ], | ||
| "array-callback-return": "error", | ||
| "array-element-newline": "off", | ||
| "arrow-body-style": "error", | ||
| "arrow-parens": [ | ||
| "error", | ||
| "as-needed" | ||
| ], | ||
| "arrow-spacing": [ | ||
| "error", | ||
| { | ||
| "after": true, | ||
| "before": true | ||
| } | ||
| ], | ||
| "block-scoped-var": "error", | ||
| "block-spacing": "error", | ||
| "brace-style": "off", | ||
| "callback-return": "error", | ||
| "camelcase": "off", | ||
| "capitalized-comments": "off", | ||
| "class-methods-use-this": "error", | ||
| "comma-dangle": "error", | ||
| "comma-spacing": [ | ||
| "error", | ||
| { | ||
| "after": true, | ||
| "before": false | ||
| } | ||
| ], | ||
| "comma-style": [ | ||
| "error", | ||
| "last" | ||
| ], | ||
| "complexity": "error", | ||
| "computed-property-spacing": [ | ||
| "error", | ||
| "never" | ||
| ], | ||
| "consistent-return": "off", | ||
| "consistent-this": "error", | ||
| "curly": "off", | ||
| "default-case": "off", | ||
| "dot-location": [ | ||
| "error", | ||
| "property" | ||
| ], | ||
| "dot-notation": [ | ||
| "error", | ||
| { | ||
| "allowKeywords": true | ||
| } | ||
| ], | ||
| "eol-last": "error", | ||
| "eqeqeq": "error", | ||
| "for-direction": "error", | ||
| "func-call-spacing": "error", | ||
| "func-name-matching": "error", | ||
| "func-names": "error", | ||
| "func-style": [ | ||
| "error", | ||
| "declaration" | ||
| ], | ||
| "function-paren-newline": "error", | ||
| "generator-star-spacing": "error", | ||
| "getter-return": "error", | ||
| "global-require": "error", | ||
| "guard-for-in": "error", | ||
| "handle-callback-err": "error", | ||
| "id-blacklist": "error", | ||
| "id-length": "off", | ||
| "id-match": "error", | ||
| "implicit-arrow-linebreak": [ | ||
| "error", | ||
| "beside" | ||
| ], | ||
| "indent": "off", | ||
| "indent-legacy": "off", | ||
| "init-declarations": "off", | ||
| "jsx-quotes": "error", | ||
| "key-spacing": "error", | ||
| "keyword-spacing": [ | ||
| "error", | ||
| { | ||
| "after": true, | ||
| "before": true | ||
| } | ||
| ], | ||
| "line-comment-position": "error", | ||
| "lines-around-comment": "error", | ||
| "lines-around-directive": "error", | ||
| "lines-between-class-members": [ | ||
| "error", | ||
| "always" | ||
| ], | ||
| "max-depth": "error", | ||
| "max-len": "off", | ||
| "max-lines": "off", | ||
| "max-nested-callbacks": "error", | ||
| "max-params": "off", | ||
| "max-statements": "off", | ||
| "max-statements-per-line": "error", | ||
| "multiline-comment-style": [ | ||
| "error", | ||
| "separate-lines" | ||
| ], | ||
| "new-cap": "error", | ||
| "new-parens": "error", | ||
| "newline-after-var": "off", | ||
| "newline-before-return": "off", | ||
| "newline-per-chained-call": "off", | ||
| "no-alert": "error", | ||
| "no-array-constructor": "error", | ||
| "no-await-in-loop": "error", | ||
| "no-bitwise": "error", | ||
| "no-buffer-constructor": "error", | ||
| "no-caller": "error", | ||
| "no-catch-shadow": "error", | ||
| "no-confusing-arrow": "error", | ||
| "no-constant-condition": [ | ||
| "error", | ||
| { | ||
| "checkLoops": false | ||
| } | ||
| ], | ||
| "no-continue": "off", | ||
| "no-div-regex": "error", | ||
| "no-duplicate-imports": "error", | ||
| "no-else-return": "off", | ||
| "no-empty-function": "error", | ||
| "no-eq-null": "error", | ||
| "no-eval": "error", | ||
| "no-extend-native": "error", | ||
| "no-extra-bind": "error", | ||
| "no-extra-label": "error", | ||
| "no-extra-parens": "error", | ||
| "no-floating-decimal": "error", | ||
| "no-implicit-globals": "error", | ||
| "no-implied-eval": "error", | ||
| "no-inline-comments": "error", | ||
| "no-invalid-this": "error", | ||
| "no-iterator": "error", | ||
| "no-label-var": "error", | ||
| "no-labels": "error", | ||
| "no-lone-blocks": "error", | ||
| "no-lonely-if": "error", | ||
| "no-loop-func": "error", | ||
| "no-magic-numbers": "off", | ||
| "no-mixed-operators": "error", | ||
| "no-mixed-requires": "error", | ||
| "no-multi-assign": "off", | ||
| "no-multi-spaces": "error", | ||
| "no-multi-str": "error", | ||
| "no-multiple-empty-lines": "error", | ||
| "no-native-reassign": "error", | ||
| "no-negated-condition": "error", | ||
| "no-negated-in-lhs": "error", | ||
| "no-nested-ternary": "error", | ||
| "no-new": "error", | ||
| "no-new-func": "error", | ||
| "no-new-object": "error", | ||
| "no-new-require": "error", | ||
| "no-new-wrappers": "error", | ||
| "no-octal-escape": "error", | ||
| "no-param-reassign": "off", | ||
| "no-path-concat": "error", | ||
| "no-plusplus": "off", | ||
| "no-process-env": "error", | ||
| "no-process-exit": "error", | ||
| "no-proto": "error", | ||
| "no-prototype-builtins": "error", | ||
| "no-restricted-globals": "error", | ||
| "no-restricted-imports": "error", | ||
| "no-restricted-modules": "error", | ||
| "no-restricted-properties": "error", | ||
| "no-restricted-syntax": "error", | ||
| "no-return-assign": "error", | ||
| "no-return-await": "error", | ||
| "no-script-url": "error", | ||
| "no-self-compare": "error", | ||
| "no-sequences": "error", | ||
| "no-shadow": "off", | ||
| "no-shadow-restricted-names": "error", | ||
| "no-spaced-func": "error", | ||
| "no-sync": "error", | ||
| "no-tabs": "error", | ||
| "no-template-curly-in-string": "error", | ||
| "no-ternary": "off", | ||
| "no-throw-literal": "error", | ||
| "no-trailing-spaces": "error", | ||
| "no-undef-init": "error", | ||
| "no-undefined": "off", | ||
| "no-underscore-dangle": "off", | ||
| "no-unmodified-loop-condition": "off", | ||
| "no-unneeded-ternary": "error", | ||
| "no-use-before-define": "off", | ||
| "no-useless-call": "error", | ||
| "no-useless-computed-key": "error", | ||
| "no-useless-concat": "error", | ||
| "no-useless-constructor": "error", | ||
| "no-useless-rename": "error", | ||
| "no-useless-return": "error", | ||
| "no-var": "error", | ||
| "no-void": "error", | ||
| "no-warning-comments": "off", | ||
| "no-whitespace-before-property": "error", | ||
| "no-with": "error", | ||
| "nonblock-statement-body-position": [ | ||
| "error", | ||
| "any" | ||
| ], | ||
| "object-curly-newline": "off", | ||
| "object-curly-spacing": [ | ||
| "error", | ||
| "always" | ||
| ], | ||
| "object-shorthand": "error", | ||
| "one-var": "off", | ||
| "one-var-declaration-per-line": "error", | ||
| "operator-assignment": [ | ||
| "error", | ||
| "always" | ||
| ], | ||
| "operator-linebreak": "error", | ||
| "padded-blocks": "off", | ||
| "padding-line-between-statements": "error", | ||
| "prefer-arrow-callback": "error", | ||
| "prefer-const": "error", | ||
| "prefer-destructuring": "error", | ||
| "prefer-numeric-literals": "error", | ||
| "prefer-promise-reject-errors": "error", | ||
| "prefer-reflect": "off", | ||
| "prefer-rest-params": "error", | ||
| "prefer-spread": "error", | ||
| "prefer-template": "off", | ||
| "quote-props": "off", | ||
| "quotes": "off", | ||
| "radix": "error", | ||
| "require-await": "error", | ||
| "require-jsdoc": "off", | ||
| "rest-spread-spacing": [ | ||
| "error", | ||
| "never" | ||
| ], | ||
| "semi": "error", | ||
| "semi-spacing": [ | ||
| "error", | ||
| { | ||
| "after": true, | ||
| "before": false | ||
| } | ||
| ], | ||
| "semi-style": [ | ||
| "error", | ||
| "last" | ||
| ], | ||
| "sort-imports": "error", | ||
| "sort-keys": "off", | ||
| "sort-vars": "error", | ||
| "space-before-blocks": "error", | ||
| "space-before-function-paren": "off", | ||
| "space-in-parens": [ | ||
| "error", | ||
| "never" | ||
| ], | ||
| "space-infix-ops": "error", | ||
| "space-unary-ops": "error", | ||
| "spaced-comment": [ | ||
| "error", | ||
| "always" | ||
| ], | ||
| "strict": "error", | ||
| "switch-colon-spacing": [ | ||
| "error", | ||
| { | ||
| "after": true, | ||
| "before": false | ||
| } | ||
| ], | ||
| "symbol-description": "error", | ||
| "template-curly-spacing": [ | ||
| "error", | ||
| "never" | ||
| ], | ||
| "template-tag-spacing": "error", | ||
| "unicode-bom": [ | ||
| "error", | ||
| "never" | ||
| ], | ||
| "valid-jsdoc": "off", | ||
| "vars-on-top": "error", | ||
| "wrap-iife": "error", | ||
| "wrap-regex": "error", | ||
| "yield-star-spacing": "error", | ||
| "yoda": [ | ||
| "error", | ||
| "never" | ||
| ] | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Given that we are extending “eslint:recommended”, it possible to only list the ones we are changing?
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 think the generated one is more strict, as
eslint --initreads our existing code to get an optimized configuration. For example,array-callback-returnis not enabled by default ineslint:recommended.Uh oh!
There was an error while loading. Please reload this page.
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.
We may still review those
offthings, though.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.
So it seems we can just remove those
offlines, but IMO maybe those lines are helpful for future reconsideration (at least we know they exist!). Should they be removed?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 don’t mind keeping it as is, but I’m worried that we don’t know which are set by us or why - and the recommended set can change or have new things added. I guess it’s not a big deal as the code base is only small.
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.
We have rules list and their detailed descriptions and examples, so maybe we can further modify the configuration if we meet some problems.
I'm hesitating to just remove them, as some actually are helpful... 636947f