forked from Shopify/eslint-plugin-shopify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprettier.js
44 lines (38 loc) · 1.26 KB
/
prettier.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const merge = require('merge');
module.exports = {
extends: ['prettier'],
plugins: ['prettier'],
rules: merge(require('./rules/prettier'), {
// rules to disable to prefer prettier
'shopify/class-property-semi': 'off',
'shopify/binary-assignment-parens': 'off',
'babel/semi': 'off',
// Special rule for 'lines-around-comment'
// https://github.com/prettier/eslint-config-prettier/blob/984de70e8c6b57684b444283561019389ccebd11/README.md#lines-around-comment
'lines-around-comment': [
'error',
{
beforeBlockComment: true,
},
],
// Special rule for 'no-unexpected-multiline'
// https://github.com/prettier/eslint-config-prettier/blob/5399175c37466747aae9d407021dffec2c169c8b/README.md#no-unexpected-multiline
'no-unexpected-multiline': 'error',
}),
overrides: [
{
// disable prettier processing of graphql files
// eslint-plugin-graphql is required to process graphql files, but it also
// suppresses all lint violations except its own, which results in a
// wasteful no-op.
files: ['*.graphql', '*.gql'],
rules: {
'prettier/prettier': 'off',
},
},
{
files: ['*.ts', '*.tsx'],
rules: require('./rules/prettier-typescript'),
},
],
};