prettier / prettier-eslint-cli

CLI for prettier-eslint
https://npm.im/prettier-eslint-cli
MIT License
537 stars 85 forks source link

Option to fix only `layout` issues #429

Open sryze opened 2 years ago

sryze commented 2 years ago

Relevant code/config.

npm install --save-dev prettier-eslint
import React from 'react';

export default function Component() {
    return (
        <div>
            <a href="http://google.com/" target="_blank">Test</a>
        </div>
    );
}

What you did:

npx prettier-eslint --write Component.js

What happened:

prettier-eslint added rel="noreferrer" to the <a> element:

import React from 'react';

export default function Component() {
    return (
        <div>
            <a href="http://google.com/" target="_blank" rel="noreferrer">
                Test
            </a>
        </div>
    );
}

Reproduction:

Problem description:

I'd like to have prettier-eslint fix only code style issues (spacing, formatting, etc), rather than all autofixable issues. But there seems to be no option to achieve this.

Suggested solution:

Perhaps provide a command-line option to change the --fix-type option of ESLint?

More info here: https://eslint.org/docs/user-guide/command-line-interface#--fix-type

JounQin commented 2 years ago

PR welcome to add this feature!