Skip to content

Commit

Permalink
lint: use ts-standard for linting and fix lint isues
Browse files Browse the repository at this point in the history
Similar to the bottom piece of agilgur5/react-signature-canvas@c70cc5a
- I didn't know ts-standard was a thing and had been using eslint-config-standard-with-typescript and all the deps instead before (which itself was a relatively recent development)

- I had put off adding ts-standard here to this repo/boilerplate due to its conflicts with `tsc`
  - I suspect the conflicts are because of ts-standard's old version of ESLint that may not have brought it in sync with the TS developments around index signatures
    - ts-standard (and the whole standard ecosystem, tbh) have been suffering a bit of lack of maintenance and so have been slow to upgrade etc
      - for a summary, see standard/ts-standard#222 -- I might just tackle some of the remaining tasks myself?
    - and as it doesn't seem like it'll be upgraded anytime too soon, figured I might as well bring it in before I put it off for too long
  - was able to eslint-ignore the 3 conflicts, so think that's good enough as a workaround _for now_
    - it doesn't seem to be that much of a problem _within_ some of my other libraries' codebases (as opposed to just in the config), so think it's ok for now unless it starts to pose more problems

- remove trailing commas per current ts-standard style
  - maybe this is changed in newer versions of standard? since trailing commas are better, but may not have been fully supported before

- remove `package-json-type` dep as it wasn't helping much and also causing type issues due to custom fields
  • Loading branch information
agilgur5 committed Jun 14, 2022
1 parent 2d4d705 commit f88e1b7
Show file tree
Hide file tree
Showing 4 changed files with 10,960 additions and 6,735 deletions.
4 changes: 2 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const pkgJson = require('./package.json')

const runtimeVersion = pkgJson.dependencies['@babel/runtime']
const NODE_ENV = process.env['NODE_ENV']
const NODE_ENV = process.env['NODE_ENV'] // eslint-disable-line dot-notation -- this conflicts with tsc, possibly due to outdated ESLint

/** @type {import('@babel/core').ConfigFunction} */
module.exports = api => {
Expand All @@ -17,7 +17,7 @@ module.exports = api => {
return {
presets: [
presetEnv,
'@babel/preset-typescript',
'@babel/preset-typescript'
],
plugins: [
// used with @rollup/plugin-babel
Expand Down

0 comments on commit f88e1b7

Please sign in to comment.