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

Supplying --prettier always results in a broken configuration #1396

Closed
hyperupcall opened this issue Mar 1, 2022 · 0 comments · Fixed by #1397
Closed

Supplying --prettier always results in a broken configuration #1396

hyperupcall opened this issue Mar 1, 2022 · 0 comments · Fixed by #1397
Labels
status: accepting prs Please, send in a PR to resolve this! ✨ type: bug Something isn't working

Comments

@hyperupcall
Copy link
Contributor

hyperupcall commented Mar 1, 2022

🐛 Bug Report

  • tslint-to-eslint-config version: 2.11.0
  • ESLint version: 8.10.0
  • Node version: v14.19.0

Actual Behavior

Running tslint-to-eslint-config with the --prettier flag, and subsequently running ESLint runs into the following:

Oops! Something went wrong! :(

ESLint: 8.10.0

Error: Cannot read config file: /tmp/tmp.oUi9YFaB6U/comment-divider/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint-config-prettier/@typescript-eslint.js
Error: "prettier/@typescript-eslint" has been merged into "prettier" in eslint-config-prettier 8.0.0. See: https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md#version-800-2021-02-21
Referenced from: /tmp/tmp.oUi9YFaB6U/comment-divider/.eslintrc.js
    at Object.<anonymous> (/tmp/tmp.oUi9YFaB6U/comment-divider/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint-config-prettier/@typescript-eslint.js:1:69)
    at Module._compile (/tmp/tmp.oUi9YFaB6U/comment-divider/node_modules/.pnpm/[email protected]/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at Object.module.exports [as default] (/tmp/tmp.oUi9YFaB6U/comment-divider/node_modules/.pnpm/[email protected]/node_modules/import-fresh/index.js:32:59)
    at loadJSConfigFile (/tmp/tmp.oUi9YFaB6U/comment-divider/node_modules/.pnpm/@[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2559:47)
    at loadConfigFile (/tmp/tmp.oUi9YFaB6U/comment-divider/node_modules/.pnpm/@[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2643:20)
    at ConfigArrayFactory._loadConfigData (/tmp/tmp.oUi9YFaB6U/comment-divider/node_modules/.pnpm/@[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2947:42)

Expected Behavior

No errors

Reproduction

$ yarn add tslint-to-eslint-config eslint
$ echo '{}' >| tslint.json
$ yarn run tslint-to-eslint-config --prettier
...
.eslintrc.js
/*
👋 Hi! This file was autogenerated by tslint-to-eslint-config.
https://github.com/typescript-eslint/tslint-to-eslint-config

It represents the closest reasonable ESLint configuration to this
project's original TSLint configuration.

We recommend eventually switching this configuration to extend from
the recommended rulesets in typescript-eslint. 
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md

Happy linting! 💖
*/
module.exports = {
    "env": {
        "browser": true,
        "es6": true
    },
    "extends": [
        "prettier",
        "prettier/@typescript-eslint"
    ],
    "parser": "@typescript-eslint/parser",
    "parserOptions": {
        "project": "tsconfig.json",
        "sourceType": "module"
    },
    "plugins": [
        "@typescript-eslint"
    ]
};

The issue wasn't systemic and the fix seemed pretty trivial, so I went ahead and made a PR for this

@JoshuaKGoldberg JoshuaKGoldberg added status: accepting prs Please, send in a PR to resolve this! ✨ type: bug Something isn't working labels Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Please, send in a PR to resolve this! ✨ type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants