Passing through a --fix flag/option to eslint might be a nice, lightweight alternative to using a full formatter like standard-format without adding any additional dependencies,
Looking at standard, about 25% of the rules are covered by --fix currently:
arrow-spacing: enforce consistent spacing before and after the arrow in arrow functions
block-spacing: enforce consistent spacing inside single-line blocks
comma-dangle: require or disallow trailing commas
comma-spacing: enforce consistent spacing before and after commas
eol-last: enforce at least one newline at the end of files
generator-star-spacing: enforce consistent spacing around * operators in generator functions
indent: enforce consistent indentation
jsx-quotes: enforce the consistent use of either double or single quotes in JSX attributes
keyword-spacing: enforce consistent spacing before and after keywords
no-multi-spaces: disallow multiple spaces
no-spaced-func: disallow spacing between function identifiers and their applications
no-trailing-spaces: disallow trailing whitespace at the end of lines
no-whitespace-before-property: disallow whitespace before properties
quotes: enforce the consistent use of either backticks, double, or single quotes
semi-spacing: enforce consistent spacing before and after semicolons
semi: require or disallow semicolons instead of ASI
space-before-blocks: enforce consistent spacing before blocks
space-before-function-paren: enforce consistent spacing before function definition opening parenthesis
space-in-parens: enforce consistent spacing inside parentheses
space-infix-ops: require spacing around operators
space-unary-ops: enforce consistent spacing before or after unary operators
spaced-comment: enforce consistent spacing after the // or /* in a comment
template-curly-spacing: require or disallow spacing around embedded expressions of template strings
yield-star-spacing: require or disallow spacing around the * in yield* expressions
This is a lot more rules than last time I checked!
I'd like to see standard-engine expose a --fix flag via the CLI as well as opts.fix for programmatic usage.
Thoughts?
Passing through a
--fixflag/option to eslint might be a nice, lightweight alternative to using a full formatter likestandard-formatwithout adding any additional dependencies,Looking at
standard, about 25% of the rules are covered by--fixcurrently:This is a lot more rules than last time I checked!
I'd like to see
standard-engineexpose a--fixflag via the CLI as well asopts.fixfor programmatic usage.Thoughts?