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

Switch from TSLint to typescript-eslint #335

Closed
JoshuaKGoldberg opened this issue Oct 2, 2019 · 5 comments
Closed

Switch from TSLint to typescript-eslint #335

JoshuaKGoldberg opened this issue Oct 2, 2019 · 5 comments
Assignees
Labels
area: reporting Related to how TypeStat creates output good first issue Good for newcomers, please hop on! 🙌 status: accepting prs Please, send a pull request to resolve this! 🙏

Comments

@JoshuaKGoldberg
Copy link
Owner

This repository still uses TSLint, which is being deprecated: palantir/tslint#4534. It'd be great to move it over to typescript-eslint to no longer use deprecated packages.

Protip: tslint-to-eslint-config is the recommended package to do so!

@JoshuaKGoldberg JoshuaKGoldberg added status: accepting prs Please, send a pull request to resolve this! 🙏 good first issue Good for newcomers, please hop on! 🙌 area: reporting Related to how TypeStat creates output hacktoberfest labels Oct 2, 2019
@arvidboivie
Copy link

I'm having a go at this!

@arvidboivie
Copy link

I'm having issues running verify on the project, even without any changes. I'm probably missing something easy, and don't want to go making changes to get this working. The tests are failing, here's the output:

 FAIL  src/shared/NameGenerator.test.ts
  ● Test suite failed to run

    Jest encountered an unexpected token

    This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.

    By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".

    Here's what you can do:
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/en/configuration.html

    Details:

    /Users/arbo/repos/hacktoberfest/TypeStat/src/shared/NameGenerator.ts:12
      countsPerBase = new Map();
                    ^

    SyntaxError: Unexpected token =

    > 1 | import { NameGenerator } from "./NameGenerator";
        | ^
      2 |
      3 | describe("NameGenerator", () => {
      4 |     it("creates a basic name when the base portion hasn't been requested yet", () => {

      at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:537:17)
      at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:579:25)
      at Object.<anonymous> (src/shared/NameGenerator.test.ts:1:1)

 FAIL  src/cli/runCli.test.ts
  ● Test suite failed to run

    Jest encountered an unexpected token

    This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.

    By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".

    Here's what you can do:
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/en/configuration.html

    Details:

    /Users/arbo/repos/hacktoberfest/TypeStat/src/shared/FileInfoCache.ts:17
      nodeReferences = new Map();
                     ^

    SyntaxError: Unexpected token =

      4 | import { TypeStatOptions } from "../../options/types";
      5 | import { LazyCache } from "../../services/LazyCache";
    > 6 | import { FileInfoCache } from "../../shared/FileInfoCache";
        | ^
      7 | import { convertMapToObject, Dictionary } from "../../shared/maps";
      8 | import { NameGenerator } from "../../shared/NameGenerator";
      9 | import { collectFilteredNodes } from "../collectFilteredNodes";

      at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:537:17)
      at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:579:25)
      at Object.<anonymous> (src/runtime/providers/createCoreMutationsProvider.ts:6:1)

@JoshuaKGoldberg
Copy link
Owner Author

Oh 😦 I don't get those errors locally on a fresh clone @arvidboivie, working on Windows. Maybe the issue is Mac/*nix specific?

Anyway, you can ignore them - you shouldn't need to run yarn run verify for this issue. Just running yarn run eslint after it's created should be sufficient. Does that help?

@arvidboivie
Copy link

@JoshuaKGoldberg You're right, I skipped looking at those errors. Probably Mac related. Tried my hand at replacing the rules, PR up now.

@JoshuaKGoldberg JoshuaKGoldberg self-assigned this Nov 16, 2019
@JoshuaKGoldberg
Copy link
Owner Author

Fixed by #371.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: reporting Related to how TypeStat creates output good first issue Good for newcomers, please hop on! 🙌 status: accepting prs Please, send a pull request to resolve this! 🙏
Projects
None yet
Development

No branches or pull requests

2 participants