aladdin-add / eslint-plugin

autofix some errors reported by eslint rules.
107 stars 10 forks source link

eslint-plugin-autofix bug #64

Closed rowrowrowrow closed 3 years ago

rowrowrowrow commented 4 years ago

Tell us about your environment

"^6.8.0"

"^1.0.0"

module.exports = { "extends": ["react-app", "plugin:jsx-a11y/recommended"], "plugins": ["autofix", "jsx-a11y"], "rules": { "autofix/no-debugger": "error", "autofix/no-console": "error", "autofix/no-plusplus": "error", "autofix/no-unused-vars": "warn", } }

Expected behavior

run: 'eslint src' or 'eslint src --fix' expectation: Autofixes according to the defined rules

Actual behavior

typeError: Cannot read property 'range' of null Occurs while linting.....

Note: I've tried each plugin individually and it occurs for each plugin. I've tried other plugins and the error doesn't occur.

aladdin-add commented 4 years ago

hi, sorry for the late! can you share your source code?

MaffooBristol commented 4 years ago

I also have this issue, I believe it was introduced by later versions of babel-eslint and perhaps due to duplicated instances of @babel/types https://github.com/babel/babel-eslint/issues/681

aladdin-add commented 4 years ago

sounds like that way. an example code can be helpful!

giuliano-december commented 3 years ago

@aladdin-add I'm having the same problem. Seems like the problem is unused function parameters:


// exits with error: typeError: Cannot read property 'range' of null
export const startToolExercise = async (toolId: number): Promise<string> => {
  return '1'
}

// works fine
export const startToolExercise = async (toolId: number): Promise<string> => {
  toolId;
  return '1'
}
aladdin-add commented 3 years ago

I'm going to close the issue, as @MaffooBristol mentioned :the error is something related with babel-eslint, but not related to the plugin.

please upgrade to latest babel-eslint => @babel/eslint-parser to see if it has been fixed!