Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit 64b8ffc

Browse files
author
Christopher Quadflieg
committed
chore: add linebreak-style rule
1 parent 7797872 commit 64b8ffc

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

.eslintrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ module.exports = defineConfig({
9797
'greasemonkey',
9898
'jsdoc',
9999
'jsx',
100+
'linebreak',
100101
'loc',
101102
'multiline',
102103
'nashorn',
@@ -108,6 +109,7 @@ module.exports = defineConfig({
108109
'sharedmemory',
109110
'tsconfig',
110111
'typedarrays',
112+
'unix',
111113
'webextensions',
112114
'webworker',
113115
'wellknown',

src/rules/eslint/index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import type { CommaDangleRule } from './comma-dangle';
22
import type { CurlyRule } from './curly';
3+
import type { LinebreakStyleRule } from './linebreak-style';
34
import type { NoDebuggerRule } from './no-debugger';
45
import type { QuotesRule } from './quotes';
56
import type { SemiRule } from './semi';
67

78
/**
89
* All eslint rules.
910
*/
10-
export type EslintRules = CommaDangleRule & CurlyRule & NoDebuggerRule & QuotesRule & SemiRule;
11+
export type EslintRules = CommaDangleRule & CurlyRule & LinebreakStyleRule & NoDebuggerRule & QuotesRule & SemiRule;

src/rules/eslint/linebreak-style.d.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import type { RuleConfig } from '../rule-config';
2+
3+
/**
4+
* Option.
5+
*/
6+
export type LinebreakStyleOption = 'unix' | 'windows';
7+
8+
/**
9+
* Options.
10+
*/
11+
export type LinebreakStyleOptions = [LinebreakStyleOption?];
12+
13+
/**
14+
* Enforce consistent linebreak style.
15+
*
16+
* @see [linebreak-style](https://eslint.org/docs/rules/linebreak-style)
17+
*/
18+
export type LinebreakStyleRuleConfig = RuleConfig<LinebreakStyleOptions>;
19+
20+
/**
21+
* Enforce consistent linebreak style.
22+
*
23+
* @see [linebreak-style](https://eslint.org/docs/rules/linebreak-style)
24+
*/
25+
export interface LinebreakStyleRule {
26+
/**
27+
* Enforce consistent linebreak style.
28+
*
29+
* @see [linebreak-style](https://eslint.org/docs/rules/linebreak-style)
30+
*/
31+
'linebreak-style': LinebreakStyleRuleConfig;
32+
}

0 commit comments

Comments
 (0)