eslint-plugin-prettier-doc
v1.1.0
Published
ESLint rules for Prettier Doc.
Downloads
3,217
Readme
eslint-plugin-prettier-doc
ESLint rules for Prettier Doc.
Install
yarn add eslint-plugin-prettier-doc --dev
Usage
Add prettier-doc
to the plugins
and extends
sections of your .eslintrc
configuration file.
{
"extends": ["plugin:prettier-doc/recommended"]
}
Rules
no-concat
concat(…)
has been deprecated, usearray
instead.
This rule is fixable.
Please disable this rule before fixing no-nested-concat
, and no-single-doc-concat
, they both relay on checking concat(…)
call
// Fail
const doc = concat(['prettier', line, '(', line, ')'])
// Pass
const doc = ['prettier', line, '(', line, ')']
no-empty-flat-contents-for-if-break
The second argument (flatContents) for
ifBreak(…)
should omitted when it's empty.
This rule is fixable.
// Fail
const comma = ifBreak(',', '')
// Pass
const comma = ifBreak(',')
no-nested-concat
Nested
concat(…)
should be flatted.
This rule is fixable.
// Fail
const doc = concat(['prettier', concat([line, '(', line, ')'])])
// Pass
const doc = concat(['prettier', line, '(', line, ')'])
no-single-document-concat
Single
Doc
should use directly.
This rule is fixable.
// Fail
const doc = concat(['prettier()'])
// Pass
const doc = 'prettier()'