11import type { Linter } from 'eslint' ;
22
3- const lineLength = 120 ;
4-
53export const common : Linter . RulesRecord = {
64 'array-callback-return' : [
75 'error' ,
@@ -10,28 +8,13 @@ export const common: Linter.RulesRecord = {
108 } ,
119 ] , // Allow implicit return in array methods
1210 'arrow-body-style' : [ 'error' , 'as-needed' ] , // Allow omitting braces when possible
13- 'arrow-parens' : [ 'error' , 'always' ] , // Require parens around arrow function arguments
14- 'comma-dangle' : 'off' , // Allow dangling commas
1511 'consistent-return' : 'off' , // Allow implicit return in arrow functions
1612 curly : [ 'error' , 'all' ] , // Require braces around all blocks
1713 'default-case' : 'off' , // Allow switch statements without default
1814 'function-paren-newline' : 'off' , // Allow parens on same line as function name
1915 'guard-for-in' : 'off' , // Allow for-in without if statement
2016 'implicit-arrow-linebreak' : 'off' , // Allow implicit return in arrow functions
2117 'max-classes-per-file' : [ 'error' , { ignoreExpressions : true , max : 3 } ] , // Allow multiple classes per file
22- 'max-len' : [
23- // Enforce max line length
24- 'error' ,
25- lineLength , // Characters per line
26- 2 , // Tab width
27- {
28- ignoreUrls : true , // Let URLs be as long as they need to be
29- ignoreComments : true , // Allow comments to be as long as they need to be
30- ignoreRegExpLiterals : true , // Let regex literals be as long as they need to be
31- ignoreStrings : true , // Let strings be as long as they need to be
32- ignoreTemplateLiterals : true , // Let template literals be as long as they need to be
33- } ,
34- ] ,
3518 'no-confusing-arrow' : 'off' , // Do not guard against confusing arrow functions as we enforce parens
3619 'no-console' : 'warn' , // Warn against console.log
3720 'no-debugger' : 'warn' , // Warn against debugger
@@ -67,5 +50,4 @@ export const common: Linter.RulesRecord = {
6750 'no-shadow' : 'off' , // Allow variables shadowing
6851 'no-use-before-define' : 'off' , // Guarded by @typescript -eslint/no-use-before-define
6952 'no-warning-comments' : [ 'warn' , { terms : [ 'fixme' , 'todo' ] } ] , // Warn against fixme and todo comments
70- 'object-curly-newline' : [ 'error' , { consistent : true } ] , // Enforce consistent line breaks inside braces
7153} ;
0 commit comments