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

.editorconfig missing quote_type = single for formatting of typescript files #580

Closed
1 of 4 tasks
joboyx opened this issue Dec 27, 2020 · 3 comments
Closed
1 of 4 tasks

Comments

@joboyx
Copy link

joboyx commented Dec 27, 2020

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request
  • Question

Current behavior

Using prettier as formatter in VSCode, format whole .ts typescript file makes all single-quote (') as double quotes (")

image

Expected behavior

Expected is that when organizing imports and formatting document all quotes should be single

image

Minimal reproduction of the problem with instructions

Environment



ngX-Rocket: 9.1.0
Node.js: v15.2.1
Npm: 7.0.8
OS: darwin x64 20.2.0

Generated project options:
{
  "generator-addon-firebase": {
    "firebaseDeploy": true,
    "version": "3.0.1",
    "props": {
      "firebaseDeploy": true,
      "appName": "tursido-app",
      "projectName": "tursido-app",
      "packageManager": "npm",
      "location": "path",
      "strict": false,
      "skipInstall": false,
      "skipQuickstart": false,
      "initGit": true,
      "usePrefix": true,
      "target": [
        "web"
      ],
      "pwa": true,
      "ui": "ionic",
      "layout": "tabs",
      "auth": true,
      "lazy": true,
      "angulartics": false,
      "languages": [
        "en-US"
      ],
      "tools": [],
      "utility": [
        "lodash"
      ],
      "deploy": "firebase",
      "mobile": [],
      "desktop": []
    }
  },
  "generator-ngx-rocket": {
    "version": "9.1.0",
    "props": {
      "location": "path",
      "strict": false,
      "skipInstall": false,
      "skipQuickstart": false,
      "initGit": true,
      "usePrefix": true,
      "appName": "tursido-app",
      "target": [
        "web"
      ],
      "pwa": true,
      "ui": "ionic",
      "layout": "tabs",
      "auth": true,
      "lazy": true,
      "angulartics": false,
      "languages": [
        "en-US"
      ],
      "tools": [],
      "utility": [
        "lodash"
      ],
      "deploy": "firebase",
      "projectName": "tursido-app",
      "packageManager": "npm",
      "mobile": [],
      "desktop": []
    }
  }
}

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 10.1.7
Node: 15.2.1
OS: darwin x64

Angular: 10.2.4
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1100.5
@angular-devkit/build-angular   0.1001.7
@angular-devkit/core            11.0.5
@angular-devkit/schematics      10.1.7
@angular/cdk                    10.2.7
@angular/cli                    10.1.7
@angular/fire                   6.1.4
@angular/flex-layout            10.0.0-beta.32
@schematics/angular             10.1.7
@schematics/update              0.1001.7
rxjs                            6.6.3
typescript                      4.0.5

Others:

ℹ️ WORKAROUND

  • Update .editorconfig with
[*.ts]
quote_type = single

image

I think as a fix, this manual change to .editorconfig should be included in the boilerplate/generated code by ngx since in previous versions single quote is used by default (I think by prettier in package.json)(that's what I get used, unless this changed). So this might be a regression issue.

@sinedied
Copy link
Member

sinedied commented Jan 5, 2021

This may be an issue with the prettier VS Code extension or your config, as in the generated project there's already a setting in package.json for prettier with "singleQuote": true. You can verify that it works fine by running npm run prettier from the command line.

It would be ok to enforce the quote_type property in editorconfig, but at the moment it's a proposal and not an "officially" supported property (see https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties).

I also tried with a freshly generated project where I enabled the "prettier" option and the formatting is fine, using the settings from package.json (single quotes).

Are you sure you enabled the "prettier" option when generating your project, and you're using this extension for formatting?

@sinedied
Copy link
Member

I just saw that quote_type = single was added to the default ng11 generated app, so I wouldn't hurt to also add it.

sinedied added a commit that referenced this issue Jan 13, 2021
sinedied added a commit that referenced this issue Jan 13, 2021
ci-rebot pushed a commit that referenced this issue Jan 14, 2021
# [9.2.0](9.1.0...9.2.0) (2021-01-14)

### Bug Fixes

* app not loading with Electron v11 ([1444bf0](1444bf0))
* incorrect hads version ([ba20ff1](ba20ff1))
* rename env script to fix execution in some environments (closes [#575](#575)) ([ec93fdb](ec93fdb))
* update electron templates ([3433465](3433465))
* update generator dependencies ([bda29d9](bda29d9))
* update jest config ([4b4a357](4b4a357))
* update packages and fix peer dependencies ([64098dc](64098dc))
* update RouteReusableStrategy for Angular 11 ([#576](#576)) ([3077f5b](3077f5b))

### Features

* add brazilian portuguese language ([1a6d728](1a6d728))
* enable webpack 5 ([8592a71](8592a71))
* migrate to @ngneat/until-destroy (fix [#577](#577)) ([3a77fcb](3a77fcb))
* update editorconfig (fixes [#580](#580)) ([9f036b3](9f036b3))
@ci-rebot
Copy link
Collaborator

🎉 This issue has been resolved in version 9.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

No branches or pull requests

3 participants