Skip to content

Commit

Permalink
Add enforcement of .js extensions for require()
Browse files Browse the repository at this point in the history
DEFRA/water-abstraction-team#115

Recently, we [overhauled our project linting](#1476). We moved to ESLint v9 and its new flat file config, switched to Prettier to handle our 'style' conventions, and replaced StandardJS with Neostandard.

On that last point, the one rule we could not migrate at the time, was enforcement of `.js` extensions when requiring modules. We know Node.js will handle this for us: the extension is not required. But eventually we intend to migrate to ESM modules and from previous attempts, having the `.js` in place reduces the amount of work this requires.

We are now happy to report that in v0.12.0 [Neostandard](https://github.com/neostandard/neostandard) has adopted [eslint-plugin-import-x](https://github.com/un-ts/eslint-plugin-import-x) so we can add the rule back in, which is handy, as we've spotted new instances of folks forgetting to do this!
  • Loading branch information
Cruikshanks committed Dec 24, 2024
1 parent 3e502c1 commit 0eea6fc
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 0eea6fc

Please sign in to comment.