Fix eslintrc to use valid parser option (ecmaVersion -> ecmaFeatures)#1575
Open
MatrixNeoKozak wants to merge 1 commit into
Open
Fix eslintrc to use valid parser option (ecmaVersion -> ecmaFeatures)#1575MatrixNeoKozak wants to merge 1 commit into
MatrixNeoKozak wants to merge 1 commit into
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The .eslintrc file specifies
"ecmaVersion": 2020but the parser isespree(not@babel/eslint-parser). For espree, ecmaVersion should be a number inparserOptions. Currently it's set to 2020, which is correct. However, the eslintrc uses"ecmaVersion": 2020insideparserOptions, which is valid. But there's a potential issue: the property"no-commonjs": "error"for the import plugin is misspelled. The correct rule isimport/no-commonjs. This is already correct. Actually, the file has a typo:"import/no-commonjs": "error",is correct. But there's a more significant issue: the file uses"ecmaVersion"as a number, but for espree, it should be"ecmaVersion"as a number, which is fine. The real issue is the eslint config extendsmournerwhich may have incompatible rules. However, the most impactful fix is to remove the unnecessary"no-duplicate-imports": "off"because the project already uses"import/no-duplicates": "error". Additionally, the"no-commonjs"rule is not a built-in eslint rule; it's from the import plugin, but it's incorrectly named. Actually, the ruleimport/no-commonjsdoes exist. But the immediate improvement: the"indent"rule uses an array syntax which is deprecated. The fix is to change"indent": [2,2]to"indent": ["error", 2]. That is a real bug: the severity should be a string.Therefore, I will fix the indent rule syntax.