Skip to content

Commit

Permalink
feat: enable antfu/indent-binary-ops
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Nov 16, 2023
1 parent 8d4da21 commit d36c42b
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 5 deletions.
10 changes: 10 additions & 0 deletions fixtures/input/javascript.js
Expand Up @@ -60,3 +60,13 @@ log(`${number} is ${isEven(number) ? 'even' : 'odd'}.`);
setTimeout(() => {
log('This code runs after a delay of 2 seconds.');
}, 2000);

let a, b, c, d, foo

if (a
|| b
|| c || d
|| (d && b)
) {
foo()
}
1 change: 1 addition & 0 deletions fixtures/input/typescript.ts
Expand Up @@ -77,3 +77,4 @@ var fn = (): string => {
}

log(car1, car2, favoriteFruit, numericValue, fn())

9 changes: 9 additions & 0 deletions fixtures/output/all/javascript.js
Expand Up @@ -61,3 +61,12 @@ log(`${number} is ${isEven(number) ? 'even' : 'odd'}.`)
setTimeout(() => {
log('This code runs after a delay of 2 seconds.')
}, 2000)

let a, b, c, d, foo

if (a
|| b
|| c || d
|| (d && b)
)
foo()
9 changes: 9 additions & 0 deletions fixtures/output/js/javascript.js
Expand Up @@ -61,3 +61,12 @@ log(`${number} is ${isEven(number) ? 'even' : 'odd'}.`)
setTimeout(() => {
log('This code runs after a delay of 2 seconds.')
}, 2000)

let a, b, c, d, foo

if (a
|| b
|| c || d
|| (d && b)
)
foo()
10 changes: 10 additions & 0 deletions fixtures/output/no-style/javascript.js
Expand Up @@ -60,3 +60,13 @@ log(`${number} is ${isEven(number) ? 'even' : 'odd'}.`);
setTimeout(() => {
log('This code runs after a delay of 2 seconds.');
}, 2000);

let a, b, c, d, foo

if (a
|| b
|| c || d
|| (d && b)
) {
foo()
}
1 change: 1 addition & 0 deletions fixtures/output/no-style/typescript.ts
Expand Up @@ -77,3 +77,4 @@ const fn = (): string => {
}

log(car1, car2, favoriteFruit, numericValue, fn())

9 changes: 9 additions & 0 deletions fixtures/output/tab-double-quotes/javascript.js
Expand Up @@ -61,3 +61,12 @@ log(`${number} is ${isEven(number) ? "even" : "odd"}.`)
setTimeout(() => {
log("This code runs after a delay of 2 seconds.")
}, 2000)

let a, b, c, d, foo

if (a
|| b
|| c || d
|| (d && b)
)
foo()
9 changes: 9 additions & 0 deletions fixtures/output/ts-override/javascript.js
Expand Up @@ -61,3 +61,12 @@ log(`${number} is ${isEven(number) ? 'even' : 'odd'}.`)
setTimeout(() => {
log('This code runs after a delay of 2 seconds.')
}, 2000)

let a, b, c, d, foo

if (a
|| b
|| c || d
|| (d && b)
)
foo()
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -47,7 +47,7 @@
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"eslint-config-flat-gitignore": "^0.1.1",
"eslint-plugin-antfu": "^1.0.2",
"eslint-plugin-antfu": "^1.0.6",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-i": "^2.29.0",
"eslint-plugin-jsdoc": "^46.9.0",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/configs/stylistic.ts
Expand Up @@ -18,6 +18,7 @@ export function stylistic(options: StylisticConfig = {}): ConfigItem[] {
rules: {
'antfu/consistent-list-newline': 'error',
'antfu/if-newline': 'error',
'antfu/indent-binary-ops': ['error', { indent }],
'antfu/top-level-function': 'error',

'curly': ['error', 'multi-or-nest', 'consistent'],
Expand Down

0 comments on commit d36c42b

Please sign in to comment.