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

.eslintrc.js is overwritten on install #17

Open
vpiskunov opened this issue May 30, 2019 · 4 comments
Open

.eslintrc.js is overwritten on install #17

vpiskunov opened this issue May 30, 2019 · 4 comments

Comments

@vpiskunov
Copy link
Contributor

Think this didn't happen before, but even if it did - doesn't seem the best way to scrap the project's original .eslintrc. Perhaps we can append to it instead of writing over?

image

@jawa-the-hutt
Copy link
Collaborator

Not sure what's going on here at the moment. Below is all we are doing to adjust the eslint config...we're using the built-in CLI-Generator methods to do so. Nothing fancy as far as I know:

  // if the project is using eslint, add some global variables
  // to the eslintConfig in order to avoid no-def errors
  if (api.hasPlugin('eslint')) {
    api.extendPackage({
      eslintConfig: {
        globals: {
          TNS_APP_MODE: true,
          TNS_APP_PLATFORM: true
        }
      }
    });
  }

Here's a screenshot of the changes for a Typescript/Eslint/Prettier setup:
image

It's essentially the same for a Javascript/Eslint/Airbnb setup.

Now, I'm using vscode on MacOS. What editor are you using and which OS? I'm wondering if the git client and/or IDE makes a difference in terms of what it's detecting as changes.

@vpiskunov
Copy link
Contributor Author

Using Sourcetree(Atlassian) for my git client, though this doesn't impact it. As you can see in my screenshot, all lines that were there before plugin install, were removed, and not re-added.

To confirm this, when looking at the file itself, after install - it only contains this:

module.exports = {
  globals: {
    TNS_APP_MODE: true,
    TNS_APP_PLATFORM: true
  }
}

It's literally only that inside, so seems to not be working as intended, if you say it appends in your case.

I had issues with the @vue/airbnb inside the extends, so switched to airbnb-base. Perhaps this could be related - if the prettier & @vue/airbnb are hardcoded somewhere?

See my in-file note regarding @vue/airbnb issue:

  "plugin:vue/essential",
        // "@vue/airbnb" is default in Vue CLI 3 (UI), however it requires-in eslint-config-airbnb-base, which contains an error
        // triggering "import/no-cycle" was not defined. Weirdly, it is listed in eslint-config-airbnb-base as added/fixed
        // in current version (4.1.0). For now, use airbnb-base instead
        // "@vue/airbnb",
        "airbnb-base",

Unrelated, but to help you understand the full picture.

@jawa-the-hutt
Copy link
Collaborator

jawa-the-hutt commented May 30, 2019

Just to double-check is this happening in a UI or CLI only created project?

edit: or both?

@vpiskunov
Copy link
Contributor Author

Happened on UI created - haven't tested on CLI. I mean... UI created the project, but installed the plugin via npm/dev-branch & invoked. Can't remember if this was happening on master/release.

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

No branches or pull requests

2 participants