DEV Community

Discussion on: How to set up ESLint with StandardJS for a new React Native/TypeScript project

Collapse
 
risafj profile image
Risa Fujii • Edited

@cseelus Hi, thank you for the comment! It turns out, you don't need the package eslint-config-prettier if you're turning off prettier anyway.

So what you can do is either:

  1. Uninstall eslint-config-prettier and remove it from .eslintrc.js (if you want to use ESLint's standard js config and turn off prettier entirely), OR
  2. Keep eslint-config-prettier, and remove the line 'prettier/prettier': 'off' from .eslintrc.js (if you want to use prettier)

I've opted for option 1.
I'd forgotten to update the article accordingly - I will do this.Sorry for any confusion!

Collapse
 
cseelus profile image
Chrıs Seelus

@risafj Thanks for your reply. I tried both approches, and they didn't work, so I checked out your referenced repo (github.com/risafj/StorybookExample...), to see if the problem was with my project.

With or without both changes from your comment, same as before:

Linting errors are shown, but StandardJS stuff (like extra semicolons, double quotes, …) is not getting linted (VSCode, NeoVim) unfortunately.

VSCode

Thread Thread
 
risafj profile image
Risa Fujii

Sorry for the late response - I checked, and semicolons are linted in my environment 😞 So I don't know what the issue could be. I use VSCode and lint on save with the config below:

  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
risafj profile image
Risa Fujii

@Chrıs Seelus

Hi, it's been a few months but I realized that now you need to add the below in your ESLint rules to disable semicolons!

    semi: ['error', 'never'],
Enter fullscreen mode Exit fullscreen mode