Code Monkey home page Code Monkey logo

Comments (8)

ikatyang avatar ikatyang commented on June 8, 2024

Things to confirm:

  • Are there only tslint-plugin-prettier issues reported?
    • it might be suppressed by other rules if they report on the same place
  • Can you run prettier CLI directly to see if it's a prettier unstable problem?
  • Can you share the code snippet here so I can copy-paste to reproduce the issue?

from tslint-plugin-prettier.

TimonVS avatar TimonVS commented on June 8, 2024

Can you run prettier CLI directly to see if it's a prettier unstable problem?

Running prettier directly works fine: https://www.dropbox.com/s/kfv7694qfksrzaj/prettier.mov?dl=0

Can you share the code snippet here so I can copy-paste to reproduce the issue?

tslint.json:

{
  "defaultSeverity": "error",
  "extends": ["tslint-config-prettier"],
  "jsRules": {},
  "rulesDirectory": [
    "tslint-plugin-prettier"
  ],
  "rules": {
    "no-var-requires": false,
    "interface-name": false,
    "no-console": false,
    "curly": false,
    "object-literal-sort-keys": false,
    "prettier": {
      "severity": "warning"
    }
  }
}

.prettierrc

{
    "semi": false,
    "singleQuote": true
}

Code snippet:

function bar () {
  console.log("bar");

  console.log("bar");
}

class Hello {
  constructor () {





  }

  someMethod () {



    
  }
}

This is what happens, step for step:

function foo () {
  console.log("bar");


  console.log("bar"        );


  ^ cursor is here
}

After first auto fix:

function foo () {
  console.log("bar");


  console.log("bar"        );


^ cursor is here
}

After second auto fix:

function bar() {
  console.log('bar')

  console.log('bar')
}

class Hello {
  constructor() {}

  someMethod() {}
}

function foo() {
  console.log('bar')

  console.log('bar')
}

from tslint-plugin-prettier.

ikatyang avatar ikatyang commented on June 8, 2024

Sorry, I cannot reproduce the issue.

kapture 2017-10-05 at 18 21 39

kapture 2017-10-05 at 18 25 38

from tslint-plugin-prettier.

TimonVS avatar TimonVS commented on June 8, 2024

That's so weird, I disabled all plugins except for TSLint and created a new workspace with just the config and code from above and I'm still having the issue :/.

This is my package.json by the way:

{
  "devDependencies": {
    "prettier": "^1.7.4",
    "tslint": "^5.7.0",
    "tslint-plugin-prettier": "^1.3.0",
    "typescript": "^2.5.3"
  }
}

Maybe we're using different versions of TSLint or Prettier?

from tslint-plugin-prettier.

ikatyang avatar ikatyang commented on June 8, 2024

Looks like the same, weird.

{
  "dependencies": {
    "prettier": "^1.7.4",
    "tslint": "^5.7.0",
    "tslint-config-prettier": "^1.5.0",
    "tslint-plugin-prettier": "^1.3.0",
    "typescript": "^2.5.3"
  }
}

VSCode 1.16.1
TSLint extension: eg2.tslint v1.0.9

from tslint-plugin-prettier.

TimonVS avatar TimonVS commented on June 8, 2024

Yep, same plugin and VSCode version. And I don't have any formatting settings in my personal preferences. I'll check if coworkers are having the same issue.

from tslint-plugin-prettier.

connorjclark avatar connorjclark commented on June 8, 2024

I know this doesn't help much- but I've seen the same issue.

from tslint-plugin-prettier.

ikatyang avatar ikatyang commented on June 8, 2024

Closing this issue for housekeeping purposes but feel free to open a new issue or comment here if you found how to reproduce.

from tslint-plugin-prettier.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.