1.1.0 • Published 4 years ago
eslint-plugin-prettier-doc v1.1.0
eslint-plugin-prettier-doc 
ESLint rules for Prettier Doc.
Install
yarn add eslint-plugin-prettier-doc --devUsage
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, usearrayinstead.
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
Docshould use directly.
This rule is fixable.
// Fail
const doc = concat(['prettier()'])// Pass
const doc = 'prettier()'