question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

eslint-config: consider consuming "simple-import-sort" eslint plugin

See original GitHub issue

Hi all,

please consider within the RW linting machinery to ship by default simple-import-sort eslint plugin as would make code objectively more readable out of the box (again IMHO), and (more debatable) also eventually the json one.

current workaround is to use (in top-level’s package.json)

"devDependencies": {
    "@redwoodjs/core": "^0.19.2-canary.45",
    "eslint-plugin-json": "2.1.2",
    "eslint-plugin-simple-import-sort": "5.0.3"
  },
  "eslintConfig": {
    "extends": [
      "@redwoodjs/eslint-config"
    ],
    "plugins": [
      "json",
      "simple-import-sort"
    ],
    "rules": {
      "json/*": [
        "error",
        "allowComments"
      ],
      "simple-import-sort/sort": "error"
    }
  }, 

but IMHO would be really nice if stuff coming from generators would come ‘nice’ by default.

All the Best,

António

P.S. ironically “import sorting” is already referred as a feature of eslint-config here

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
peterpcommented, Oct 23, 2020

Hey there - we actually had something like this in our ESLint configuration before, but we removed it because it made it more difficult for people to contribute, and it didn’t work with directory named modules.

Now that we have the babel-module for directory-named-modules we could probably try this again.

1reaction
AntonioMeirelescommented, Oct 8, 2020

Oops, just a quick side note:

there was a typo im my original copy & paste. no need at all to hard-lock the versions so it would be something along …

“eslint-plugin-json”: “^2.1.2”, “eslint-plugin-simple-import-sort”: “^5.0.3”

&& thanks!

António

Read more comments on GitHub >

github_iconTop Results From Across the Web

davidjbradshaw/eslint-config-adjunct - GitHub
A reasonable collection of plugins to use alongside your main esLint configuration - GitHub - davidjbradshaw/eslint-config-adjunct: A reasonable collection ...
Read more >
Configuration Files - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
eslint/eslint - Gitter
Hi guys, I'm getting this error Failed to load plugin 'import' declared in 'serverless/.eslintrc.yml » eslint-config-airbnb-base ...
Read more >
Create a reusable ESLint config - Coding Licks
Creating an ESLint config package · Step 1: Scaffolding · Step 2: Pick a base config (optional) · Step 3: Install additional plugins...
Read more >
eslint-config-fence - npm Package Health Analysis - Snyk
Learn more about eslint-config-fence: package health score, popularity, security, maintenance, versions and more.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found