gsoft-inc / sg-web-configs

Common configurations for building web apps at ShareGate
Apache License 2.0
2 stars 0 forks source link

❗ The TypeScript eslint config should apply to js/jsx files as well, but without the rules. #22

Closed alexasselin008 closed 1 year ago

alexasselin008 commented 1 year ago

Description

Repo

In a project using ES modules, the following line causes an errror in a js file

import packageJson from "../../package.json" assert { type: "json" };

This is because the default parser doesn't work on js file with that synthax. The recommended approach is to use either babel-eslint or the typescript-eslint parser. So by adding

    overrides: [
        {
            files: [...sourceFiles, ...jsxFiles],
            parser: "@typescript-eslint/parser"
         }

the synthax wouldn't cause an eslint error