extend-chrome / ts-react-boilerplate

Chrome extension boilerplate with TypeScript and React
MIT License
70 stars 14 forks source link

Build does not run ESLint #5

Closed steinybot closed 2 years ago

steinybot commented 2 years ago

Google search terms

Describe the bug

ESLint does not run during the build.

How do we reproduce?

Change src/background/index.ts to:

console.log('background script')
const x: any = 123
console.log(x)

Run pnpm build

Expected behavior

Expected:

  2:10  warning  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any

✖ 1 problem (0 errors, 1 warning)

Actual behavior

No warning.

Screenshots

Please complete the following information:

Additional context

Weird stuff happens if I try and add eslint() to the plugins. It seems to lint some transformed input rather than the original. The warnings/errors don't match up with the source.

jacksteamdev commented 2 years ago

@steinybot Looks like this is an issue with Rollup's TS plugin: https://github.com/rollup/plugins/issues/1010

@rollup/plugin-typescript transforms TS to JS during the load step, so ESLint gets the transpiled JS, not the TS source code.