fisker Cheung

Results 1279 comments of fisker Cheung

Sorry, I don't really understand why we can't have different types for the parser and the ESLint plugin. I don't want push ESLint to change their AST type either, since...

I'm fine to add option, Prettier only need write parseOptions once, 😄 If we add a new "Shebang" to the type, when using in eslint plugin, the AST is actually...

**Prettier pr-8926** [Playground link](https://deploy-preview-8926--prettier.netlify.app/playground/#N4Igxg9gdgLgprEAuEAzArlMMCW0AEqEEAFMADpQCG+AvPgAwA0+lA9G-gA4BOcMuODwC0OAOZQIfYQGcYVHjEoAjfGvUb6ARnade-QSPGTpCACaUNVjQF8AlPgpQbIJiAhdc0GclAKeEADuAAoKCD4oVAA2gVQAnj5uyjxUYADW-ADKXKk4UGLIMDzocG5wALbKcGZm1QAyVPnoVGJwAGJS5VQCeQWR6DAQriAAFjDlUQDqIzjwMjlgcJnhszgAbrNxyOAyiSB5MkIwwSliXcio0YduAFYyAB4AQinpWVTlcHV5cBdXpSB3e6ZXpROAARXQEHgvyi1xAOR4hx422UVCqUWGvDyMEmODMMBGyAAHMx4QFDpMUlxtvokWsfm4AI6Q+AnDwREBUGTCKBwarVYZ8Zk4PgnFrnJCXWH-Q7lHCFYoykHglk-SV-NzyZS4-GEpAAJk1KRwUV6AGEIOUJSA4DIAKzDdCHAAqaIiUrhaxKAEkoLVYJkwDwcJ4AIJ+zIwOKgmGHGw2IA) ```sh --parser babel ``` **Input:** ```jsx function foo({ a = 0, // prettier-ignore-start b = 1 // prettier-ignore-end }) { } ``` **Output:** ```jsx TypeError: Cannot...

`options[Symbol.for('comments')]` have all comments, you might need it.

**Prettier pr-8926** [Playground link](https://deploy-preview-8926--prettier.netlify.app/playground/#N4Igxg9gdgLgprEAuEBDABAXnQHSu9YAeiPQAcAnOGGASzgoFpaBzKCKxgZxlQpjwFUAGjwlyVGvSat2nBABNBBFarXqNmgL4BuPHgzZxlanQbM2HON179lwZSLGkTU87KuNFyzb7-adEGEQCDI6aC5kUD4KCAB3AAU+BEiUVAAbONQAT0jggCMKVDAAa2oAZTJi2igWZBgKAFc4YLgAW3y4BQUugBlUWsbUFjgAMQ421Cla5DRGmAggkAALGDb0gHVl2nguKrA4cpSd2gA3HezZsC48kBquBhgEopZJ5AAzDIfggCsuAA8AEJFUoVVBtOC9GpwD5fFogP7-co1FjpOAARUaEHgsPS3xAVQoDwos3yqE66SWlBqMA2tAUMGWyAAHAAGYKUCAPDZFMizEzE04w4IARyx8GeoVSaC4jCgcC6XSWVDFtCoz2GbyQnzx8IebVo9SaepRaMx2Jh2rhwV4+TpDKZSAATDairR0iiAMIQNpakBwLgAViWjQeABVyakdfjTs0AJJQHqwcpgCi0MIAQUT5Rg2TRuIeWi0QA) ```sh --parser babel ``` **Input:** ```jsx a = {// prettier-ignore-start a, // prettier-ignore-end }; a = // prettier-ignore-start { a, // prettier-ignore-end }; ``` **Output:** ```jsx...

This is quit a big change, I'll need more time to test.

I'll see what I can do, when I got time.

**Prettier pr-8926** [Playground link](https://deploy-preview-8926--prettier.netlify.app/playground/#N4Igxg9gdgLgprEAuEAzArlMMCW0AEqEEAFMADpT74CGAvAIwA0lA9K-gA4BOcMucbgFocAcygReQgM4wa3GJQBGdfAzYcefAcLESpCACaVqps2YC+ASnwUoFypQxZcBIqRt3q7fAHcAFgCe+DD+ONL4EjCEkgC2NPxwxlS0ADaCMCSOUADkAB45+ADUJqal1OX4ShVQVpQWIEwgEJyuUNLIoPLcEL4ACvIIHSg0qb40gR1NStw0YADWfADKnHM4UKLIMNzocE1wsUpJhkkAMjQb6DSicABicQm4G8ggNOgwEI0g-jCxqQDqYXg0lWYDgSyGOFwADcoYEXmBpFMQOtpBk+rNRPFkKhRmimgAraR5ABCswWyxosTgp3WcBxeL2ICJeSW61E6QAiugIPAGal8SBVtw0dwXkoaEdUl8eOsYP8cIZQsgABwABiaPAgaP+s04Ly0ouh9KaAEcefAMS1hq9pEIoHAkkkvrxzTheBjrtikLiBUy0bEcFsdv72VyLfSfYymnIlAqlf5kAAmGOzHCpdkAYQgsW9IDg0gArF90GiACqS4a+wXQ3YASSgJ1gSzA3BwrQAgo2ljBAul+WiLBYgA) ```sh --parser babel ``` **Input:** ```jsx function foo({ a=1, // prettier-ignore-start b= 1 // prettier-ignore-end }) { } function foo() { // why this not formatted...

If I understand correctly , current implementation rely on attached comments, I don't think this is the right way, we move comments around sometimes. I suggest calculate the ignore ranges...