Skip to content

Instantly share code, notes, and snippets.

@corysimmons
Last active June 8, 2019 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corysimmons/d6ee1c9c4a5e557980e4da20ce01e1d3 to your computer and use it in GitHub Desktop.
Save corysimmons/d6ee1c9c4a5e557980e4da20ce01e1d3 to your computer and use it in GitHub Desktop.
With ESLint, eslint-plugin-autofix, and eslint-plugin-import you can replace VSCode's buggy `organizeImports` setting with ESLint and organize imports for an entire project in one CLI `$ yarn lint --fix`
{
"scripts": {
"lint": "eslint '{,!(node_modules)/**/}*.js'"
},
"eslintConfig": {
"plugins": [
"autofix",
"import"
],
"rules": {
"autofix/no-unused-vars": "error",
"import/order": [
"error",
{
"groups": [
[
"builtin",
"external"
],
[
"parent",
"sibling",
"index"
]
],
"newlines-between": "always"
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment