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

JSHINT expr to ESLINT no-unused-expressions #92

Open
nyagoking opened this issue Dec 21, 2017 · 2 comments
Open

JSHINT expr to ESLINT no-unused-expressions #92

nyagoking opened this issue Dec 21, 2017 · 2 comments

Comments

@nyagoking
Copy link

Given this JSHINT rule: http://jshint.com/docs/options/#expr

"expr": true

Results in ESLint: https://eslint.org/docs/rules/no-unused-expressions

"no-unused-expressions": 2

Expected ESLint rule:

"no-unused-expressions": 0

Generally, JSHINT Relaxing options suppress warnings when true is specified.

@nyagoking
Copy link
Author

nyagoking commented Dec 22, 2017

The result to which other JSHINT Relaxing options were converted is below.
Given this JSHINT rules

"asi": true,
"boss": true,
"debug": true,
"elision": true,
"eqnull": true,
"evil": true,
"globalstrict": true,
"lastsemic": true,
"laxbreak": true,
"laxcomma": true,
"loopfunc": true,
"multistr": true,
"noyield": true,
"plusplus": true,
"proto": true,
"scripturl": true,
"sub": true,
"supernew": true,
"validthis": true,
"withstmt": true

Results in ESLint

"semi": [2, "always"],
"no-cond-assign": [2, "except-parens"],
"no-debugger": 2,
"no-sparse-arrays": 2,
"no-eq-null": 2,
"no-eval": 2,
"strict": [2, "global"],
"linebreak-style": 2,
"comma-style": [2, "last"],
"no-loop-func": 2,
"no-multi-str": 2,
"require-yield": 2,
"no-plusplus": 2,
"no-proto": 2,
"no-script-url": 2,
"dot-notation": 0,
"no-new-func": 2,
"no-new-wrappers": 2,
"no-invalid-this": 2,
"no-with": 2

Expected ESLint rules

"semi": 0,
"no-cond-assign": 0,
"no-debugger": 0,
"no-sparse-arrays": 0,
"no-eq-null": 0,
"no-eval": 0,
"strict": 0,
"linebreak-style": 0,
"comma-style": 0,
"no-loop-func": 0,
"no-multi-str": 0,
"require-yield": 0,
"no-plusplus": 0,
"no-proto": 0,
"no-script-url": 0,
"dot-notation": 0,
"no-new-func": 0,
"no-new-wrappers": 0,
"no-invalid-this": 0,
"no-with": 0

Only option "sub" was correctly converted, but others were not.

@nyagoking
Copy link
Author

I found out that several options which suppresses warning are included in JSHINT Enforcing options.
Given this JSHINT rules

"funcscope": true,
"iterator": true,
"notypeof": true,
"shadow": true

Results in ESLint

"block-scoped-var": 2,
"no-iterator": 2,
"valid-typeof": 2,
"no-shadow": 0

Expected ESLint rules

"block-scoped-var": 0,
"no-iterator": 0,
"valid-typeof": 0,
"no-shadow": 0

Options except "shadow" were not converted correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant