Open pdehaan opened 1 year ago
Also https://nextjs.org/docs/pages/building-your-application/configuring/eslint and https://nextjs.org/docs/app/api-reference/next-cli#lint
We might want to use next lint (or npx next lint depending on your usage). But currently unclear on if we need to run both tsc --noEmit AND next lint or if the latter is sufficient.
After thinking about it for a bit, I think we replace our current npm run lint:js
with next lint
and keep the separate tsc --noEmit
script (and alias everything to npm run lint
for our one script to lint CSS, JavaScript, and TypeScript).
Current output from
nextjs
branch is:npm run lint:ts
```sh git rev-parse --short HEAD # b24622482 git rev-parse --abbrev-ref HEAD # nextjs npm run lint:ts > monitor@1.0.0 lint:ts > tsc --noEmit src/app/functions/server/getBreaches.ts:14:20 - error TS2554: Expected 0 arguments, but got 1. 14 const log = mozlog('hibp') ~~~~~~ src/app/functions/server/getBreaches.ts:31:25 - error TS2531: Object is possibly 'null'. 31 breach.LogoPath = /[^/]*$/.exec(breach.LogoPath)[0] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/appConstants.js:60:32 - error TS2367: This comparison appears to be unintentional because the types '"development" | "production" | "test"' and '"heroku"' have no overlap. 60 if (!process.env.SERVER_URL && process.env.NODE_ENV === 'heroku') { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/db/knexfile.js:11:3 - error TS2322: Type '{ rejectUnauthorized: boolean; }' is not assignable to type 'string | boolean | undefined'. 11 connectionObj.ssl = { rejectUnauthorized: false } ~~~~~~~~~~~~~~~~~ src/db/tables/breaches.js:9:20 - error TS2554: Expected 0 arguments, but got 1. 9 const log = mozlog('DB.breaches') ~~~~~~~~~~~~~ src/db/tables/breaches.js:18:6 - error TS2554: Expected 1-2 arguments, but got 0. 18 .returning() ~~~~~~~~~~~ node_modules/knex/types/index.d.ts:1094:7 1094 column: '*', ~~~~~~~~~~~ An argument for 'column' was not provided. src/db/tables/breaches.js:25:12 - error TS2314: Generic type 'ArrayMight be easier to tweak the linters+rules now before we add too much TypeScript+Next.js and end up having to do another big refactor in the future.
https://github.com/mozilla/blurts-server/blob/b2462248203611ea8d7f32d4614ea98bc83951c6/package.json#L27-L30