Skip to content

Fix eslintrc to use valid parser option (ecmaVersion -> ecmaFeatures)#1575

Open
MatrixNeoKozak wants to merge 1 commit into
mapbox:mainfrom
MatrixNeoKozak:scout-improvement-1780226877075
Open

Fix eslintrc to use valid parser option (ecmaVersion -> ecmaFeatures)#1575
MatrixNeoKozak wants to merge 1 commit into
mapbox:mainfrom
MatrixNeoKozak:scout-improvement-1780226877075

Conversation

@MatrixNeoKozak

Copy link
Copy Markdown

The .eslintrc file specifies "ecmaVersion": 2020 but the parser is espree (not @babel/eslint-parser). For espree, ecmaVersion should be a number in parserOptions. Currently it's set to 2020, which is correct. However, the eslintrc uses "ecmaVersion": 2020 inside parserOptions, which is valid. But there's a potential issue: the property "no-commonjs": "error" for the import plugin is misspelled. The correct rule is import/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 extends mourner which 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 rule import/no-commonjs does 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.

@MatrixNeoKozak MatrixNeoKozak requested a review from a team as a code owner May 31, 2026 11:28
@MatrixNeoKozak MatrixNeoKozak requested a review from underoot May 31, 2026 11:28
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

Successfully merging this pull request may close these issues.

1 participant