Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PoC: type-checked rules #1

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

JoshuaKGoldberg
Copy link
Owner

@JoshuaKGoldberg JoshuaKGoldberg commented Aug 3, 2023

WIP continuing from remix-run#6614. I'll split this up into a single PR per rule or group of rules to make it easier to review.

Note that remix-run#6331 already exists, so I don't need to redo work from it.

@@ -68,13 +68,28 @@ const config = {
],
parser: "@typescript-eslint/parser",
parserOptions: {
project: true,
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D'oh! I left this in, but meant to take it out. That's why on the stream I was still getting complaints about **/*.md/*.ts files and type checking!

@MichaelDeBoey
Copy link

@JoshuaKGoldberg When working on this on stream, you asked yourself something in the lines of

I'm wondering why they enable Babel as a parser by default. Maybe they're doing some none-standard JS things

I just disabled parser & parserOptions, ran ESLint again on the codebase and got the following errors

errors
remix % yarn lint
yarn run v1.22.19
$ eslint --cache .
=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <5.1.0

YOUR TYPESCRIPT VERSION: 5.1.6

Please only submit bug reports when using the officially supported version.

=============

remix/decisions/0008-only-support-js-conversion-for-app-code.md
  57:1  error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

remix/docs/file-conventions/remix-config.md
   70:39  error  Parsing error: Unexpected token =>
  191:31  error  Parsing error: Unexpected token =>

remix/docs/guides/manual-mode.md
   57:1   error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
  127:1   error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
  169:1   error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
  187:27  error  Parsing error: Unexpected token =>
  199:7   error  Parsing error: Unexpected token function
  217:9   error  Parsing error: Unexpected token function

remix/docs/guides/mdx.md
  192:32  error  Parsing error: Unexpected token =>

remix/docs/guides/styling.md
  506:20  error  Parsing error: Unexpected token .

remix/docs/other-api/dev.md
  82:1  error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

remix/docs/prettier.config.js
  3:3  error  Parsing error: Unexpected token ..

remix/integration/helpers/cf-template/remix.config.js
  2:1  error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

remix/integration/helpers/node-template/remix.config.js
  2:1  error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

remix/jest/buildRemix.js
  1:1  error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

remix/jest/transform.js
  22:3  error  Parsing error: Unexpected token ..

remix/packages/create-remix/jest.config.js
  3:3  error  Parsing error: Unexpected token ..

remix/packages/remix-architect/jest.config.js
  3:3  error  Parsing error: Unexpected token ..

remix/packages/remix-dev/CHANGELOG.md
  428:3  error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

remix/packages/remix-dev/jest.config.js
  3:3  error  Parsing error: Unexpected token ..

remix/packages/remix-eslint-config/index.js
  39:5  error  Parsing error: Unexpected token ..

remix/packages/remix-eslint-config/jest-testing-library.js
  23:9  error  Parsing error: Unexpected token ..

remix/packages/remix-express/jest.config.js
  3:3  error  Parsing error: Unexpected token ..

remix/packages/remix-node/jest.config.js
  3:3  error  Parsing error: Unexpected token ..

remix/packages/remix-react/jest.config.js
  3:3  error  Parsing error: Unexpected token ..

remix/packages/remix-server-runtime/CHANGELOG.md
  285:3  error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

remix/packages/remix-server-runtime/jest.config.js
  3:3  error  Parsing error: Unexpected token ..

remix/packages/remix-testing/jest.config.js
  3:3  error  Parsing error: Unexpected token ..

remix/packages/remix-testing/jest.setup.js
  1:1  error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

remix/rollup.config.js
  9:13  error  Parsing error: Unexpected token {

remix/rollup.utils.js
  15:11  error  Parsing error: Unexpected token {

remix/scripts/deployment-test/cypress/support/index.js
  1:1  error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

remix/scripts/playground/new.js
  12:7  error  Parsing error: Unexpected token function

remix/scripts/playground/template/remix.init/index.js
  3:40  error  Parsing error: Unexpected token =>

remix/scripts/playground/template/server.js
  27:7  error  Parsing error: Unexpected token function

remix/scripts/publish-private.js
  21:7  error  Parsing error: Unexpected token function

remix/scripts/publish.js
  23:7  error  Parsing error: Unexpected token function

remix/scripts/release.js
  30:7  error  Parsing error: Unexpected token function

remix/scripts/run-migration-on-examples.js
  8:30  error  Parsing error: Unexpected token =>

remix/scripts/utils.js
  39:7  error  Parsing error: Unexpected token function

remix/scripts/version.js
  24:7  error  Parsing error: Unexpected token function

remix/templates/arc/plugin-remix.js
  5:1  error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

remix/templates/arc/remix.config.js
  2:1  error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

remix/templates/cloudflare-pages/remix.config.js
  2:1  error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

remix/templates/cloudflare-workers/remix.config.js
  2:1  error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

remix/templates/express/remix.config.js
  2:1  error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

remix/templates/express/server.js
  1:1  error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

remix/templates/remix-javascript/app/routes/_index.jsx
  1:1  error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

✖ 49 problems (49 errors, 0 warnings)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Hope this helps you in understanding the choice that's been made in the past a bit better & makes the next steps easier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants