I want to not allow semicolons to be placed at the end of lines in my Javascript code using ESLint. "semi"
and "no-extra-semi"
don't work, and I can't find any documentation on how to do this.
AFAIK the language grammar doesn't require a semicolon after export default . However, if it's required, ESLint should only add one semicolon. ESLint will add semicolons until it stops retrying (10 times) since it will always report a missing semicolon.
Semicolons are not required for JavaScript programming, nevertheless I advice you to use it. It makes your code more readable and is actually a good practice, and almost all cool programming languages uses it. Take a stand and use it, it's up to you now!
If you want to disable an ESLint rule in a file or on a specific line, you can add a comment. On a single line: const message = 'foo'; console. log(message); // eslint-disable-line no-console // eslint-disable-next-line no-console console.
You want to set semi
to ["error", "never"]
. This will error when there is a semicolon. Documentation can be found here https://eslint.org/docs/rules/semi#never
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With