@sequencemedia/eslint-config-standard 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/standard.mjs +140 -0
- package/config/stylistic.mjs +88 -0
- package/index.mjs +16 -0
- package/package.json +45 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import n from 'eslint-plugin-n' /*
|
|
2
|
+
import p from 'eslint-plugin-promise'
|
|
3
|
+
import i from 'eslint-plugin-import' */
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: '@sequencemedia/eslint-config-standard/standard',
|
|
7
|
+
plugins: {
|
|
8
|
+
n /* ,
|
|
9
|
+
import: i,
|
|
10
|
+
promise: p */
|
|
11
|
+
},
|
|
12
|
+
rules: {
|
|
13
|
+
'no-var': 'warn',
|
|
14
|
+
'object-shorthand': ['warn', 'properties'],
|
|
15
|
+
'accessor-pairs': ['error', { setWithoutGet: true, enforceForClassMembers: true }],
|
|
16
|
+
'array-callback-return': ['error', {
|
|
17
|
+
allowImplicit: false,
|
|
18
|
+
checkForEach: false
|
|
19
|
+
}],
|
|
20
|
+
camelcase: ['error', {
|
|
21
|
+
allow: ['^UNSAFE_'],
|
|
22
|
+
properties: 'never',
|
|
23
|
+
ignoreGlobals: true
|
|
24
|
+
}],
|
|
25
|
+
'constructor-super': 'error',
|
|
26
|
+
curly: ['error', 'multi-line'],
|
|
27
|
+
'default-case-last': 'error',
|
|
28
|
+
'dot-notation': ['error', { allowKeywords: true }],
|
|
29
|
+
eqeqeq: ['error', 'always', { null: 'ignore' }],
|
|
30
|
+
'new-cap': ['error', { newIsCap: true, capIsNew: false, properties: true }],
|
|
31
|
+
'no-array-constructor': 'error',
|
|
32
|
+
'no-async-promise-executor': 'error',
|
|
33
|
+
'no-caller': 'error',
|
|
34
|
+
'no-case-declarations': 'error',
|
|
35
|
+
'no-class-assign': 'error',
|
|
36
|
+
'no-compare-neg-zero': 'error',
|
|
37
|
+
'no-cond-assign': 'error',
|
|
38
|
+
'no-const-assign': 'error',
|
|
39
|
+
'no-constant-condition': ['error', { checkLoops: false }],
|
|
40
|
+
'no-control-regex': 'error',
|
|
41
|
+
'no-debugger': 'error',
|
|
42
|
+
'no-delete-var': 'error',
|
|
43
|
+
'no-dupe-args': 'error',
|
|
44
|
+
'no-dupe-class-members': 'error',
|
|
45
|
+
'no-dupe-keys': 'error',
|
|
46
|
+
'no-duplicate-case': 'error',
|
|
47
|
+
'no-useless-backreference': 'error',
|
|
48
|
+
'no-empty': ['error', { allowEmptyCatch: true }],
|
|
49
|
+
'no-empty-character-class': 'error',
|
|
50
|
+
'no-empty-pattern': 'error',
|
|
51
|
+
'no-eval': 'error',
|
|
52
|
+
'no-ex-assign': 'error',
|
|
53
|
+
'no-extend-native': 'error',
|
|
54
|
+
'no-extra-bind': 'error',
|
|
55
|
+
'no-extra-boolean-cast': 'error',
|
|
56
|
+
'no-fallthrough': 'error',
|
|
57
|
+
'no-func-assign': 'error',
|
|
58
|
+
'no-global-assign': 'error',
|
|
59
|
+
'no-implied-eval': 'error',
|
|
60
|
+
'no-import-assign': 'error',
|
|
61
|
+
'no-invalid-regexp': 'error',
|
|
62
|
+
'no-irregular-whitespace': 'error',
|
|
63
|
+
'no-iterator': 'error',
|
|
64
|
+
'no-labels': ['error', { allowLoop: false, allowSwitch: false }],
|
|
65
|
+
'no-lone-blocks': 'error',
|
|
66
|
+
'no-loss-of-precision': 'error',
|
|
67
|
+
'no-misleading-character-class': 'error',
|
|
68
|
+
'no-prototype-builtins': 'error',
|
|
69
|
+
'no-useless-catch': 'error',
|
|
70
|
+
'no-multi-str': 'error',
|
|
71
|
+
'no-new': 'error',
|
|
72
|
+
'no-new-func': 'error',
|
|
73
|
+
'no-object-constructor': 'error',
|
|
74
|
+
'no-new-native-nonconstructor': 'error',
|
|
75
|
+
'no-new-wrappers': 'error',
|
|
76
|
+
'no-obj-calls': 'error',
|
|
77
|
+
'no-octal': 'error',
|
|
78
|
+
'no-octal-escape': 'error',
|
|
79
|
+
'no-proto': 'error',
|
|
80
|
+
'no-redeclare': ['error', { builtinGlobals: false }],
|
|
81
|
+
'no-regex-spaces': 'error',
|
|
82
|
+
'no-return-assign': ['error', 'except-parens'],
|
|
83
|
+
'no-self-assign': ['error', { props: true }],
|
|
84
|
+
'no-self-compare': 'error',
|
|
85
|
+
'no-sequences': 'error',
|
|
86
|
+
'no-shadow-restricted-names': 'error',
|
|
87
|
+
'no-sparse-arrays': 'error',
|
|
88
|
+
'no-template-curly-in-string': 'error',
|
|
89
|
+
'no-this-before-super': 'error',
|
|
90
|
+
'no-throw-literal': 'error',
|
|
91
|
+
'no-undef': 'error',
|
|
92
|
+
'no-undef-init': 'error',
|
|
93
|
+
'no-unexpected-multiline': 'error',
|
|
94
|
+
'no-unmodified-loop-condition': 'error',
|
|
95
|
+
'no-unneeded-ternary': ['error', { defaultAssignment: false }],
|
|
96
|
+
'no-unreachable': 'error',
|
|
97
|
+
'no-unreachable-loop': 'error',
|
|
98
|
+
'no-unsafe-finally': 'error',
|
|
99
|
+
'no-unsafe-negation': 'error',
|
|
100
|
+
'no-unused-expressions': ['error', {
|
|
101
|
+
allowShortCircuit: true,
|
|
102
|
+
allowTernary: true,
|
|
103
|
+
allowTaggedTemplates: true
|
|
104
|
+
}],
|
|
105
|
+
'no-unused-vars': ['error', {
|
|
106
|
+
args: 'none',
|
|
107
|
+
caughtErrors: 'none',
|
|
108
|
+
ignoreRestSiblings: true,
|
|
109
|
+
vars: 'all'
|
|
110
|
+
}],
|
|
111
|
+
'no-use-before-define': ['error', { functions: false, classes: false, variables: false }],
|
|
112
|
+
'no-useless-call': 'error',
|
|
113
|
+
'no-useless-computed-key': 'error',
|
|
114
|
+
'no-useless-constructor': 'error',
|
|
115
|
+
'no-useless-escape': 'error',
|
|
116
|
+
'no-useless-rename': 'error',
|
|
117
|
+
'no-useless-return': 'error',
|
|
118
|
+
'no-void': 'error',
|
|
119
|
+
'no-with': 'error',
|
|
120
|
+
'one-var': ['error', { initialized: 'never' }],
|
|
121
|
+
'prefer-const': ['error', { destructuring: 'all' }],
|
|
122
|
+
'prefer-promise-reject-errors': 'error',
|
|
123
|
+
'prefer-regex-literals': ['error', { disallowRedundantWrapping: true }],
|
|
124
|
+
'symbol-description': 'error',
|
|
125
|
+
'unicode-bom': ['error', 'never'],
|
|
126
|
+
'use-isnan': ['error', {
|
|
127
|
+
enforceForSwitchCase: true,
|
|
128
|
+
enforceForIndexOf: true
|
|
129
|
+
}],
|
|
130
|
+
'valid-typeof': ['error', { requireStringLiterals: true }],
|
|
131
|
+
yoda: ['error', 'never'],
|
|
132
|
+
'n/handle-callback-err': ['error', '^(err|error)$'],
|
|
133
|
+
'n/no-callback-literal': 'error',
|
|
134
|
+
'n/no-deprecated-api': 'error',
|
|
135
|
+
'n/no-exports-assign': 'error',
|
|
136
|
+
'n/no-new-require': 'error',
|
|
137
|
+
'n/no-path-concat': 'error',
|
|
138
|
+
'n/process-exit-as-throw': 'error'
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import stylistic from '@stylistic/eslint-plugin'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
name: '@sequencemedia/eslint-config-standard/stylistic',
|
|
5
|
+
plugins: {
|
|
6
|
+
'@stylistic': stylistic
|
|
7
|
+
},
|
|
8
|
+
rules: {
|
|
9
|
+
'@stylistic/array-bracket-spacing': ['error', 'never'],
|
|
10
|
+
'@stylistic/arrow-spacing': ['error', { before: true, after: true }],
|
|
11
|
+
'@stylistic/block-spacing': ['error', 'always'],
|
|
12
|
+
'@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],
|
|
13
|
+
'@stylistic/comma-dangle': ['error', {
|
|
14
|
+
arrays: 'never',
|
|
15
|
+
objects: 'never',
|
|
16
|
+
imports: 'never',
|
|
17
|
+
exports: 'never',
|
|
18
|
+
functions: 'never'
|
|
19
|
+
}],
|
|
20
|
+
'@stylistic/comma-spacing': ['error', { before: false, after: true }],
|
|
21
|
+
'@stylistic/comma-style': ['error', 'last'],
|
|
22
|
+
'@stylistic/computed-property-spacing': ['error', 'never', { enforceForClassMembers: true }],
|
|
23
|
+
'@stylistic/dot-location': ['error', 'property'],
|
|
24
|
+
'@stylistic/eol-last': 'error',
|
|
25
|
+
'@stylistic/func-call-spacing': ['error', 'never'],
|
|
26
|
+
'@stylistic/generator-star-spacing': ['error', { before: true, after: true }],
|
|
27
|
+
'@stylistic/indent': ['error', 2, {
|
|
28
|
+
SwitchCase: 1,
|
|
29
|
+
VariableDeclarator: 1,
|
|
30
|
+
outerIIFEBody: 1,
|
|
31
|
+
MemberExpression: 1,
|
|
32
|
+
FunctionDeclaration: { parameters: 1, body: 1 },
|
|
33
|
+
FunctionExpression: { parameters: 1, body: 1 },
|
|
34
|
+
CallExpression: { arguments: 1 },
|
|
35
|
+
ArrayExpression: 1,
|
|
36
|
+
ObjectExpression: 1,
|
|
37
|
+
ImportDeclaration: 1,
|
|
38
|
+
flatTernaryExpressions: false,
|
|
39
|
+
ignoreComments: false,
|
|
40
|
+
ignoredNodes: ['TemplateLiteral *', 'JSXElement', 'JSXElement > *', 'JSXAttribute', 'JSXIdentifier', 'JSXNamespacedName', 'JSXMemberExpression', 'JSXSpreadAttribute', 'JSXExpressionContainer', 'JSXOpeningElement', 'JSXClosingElement', 'JSXFragment', 'JSXOpeningFragment', 'JSXClosingFragment', 'JSXText', 'JSXEmptyExpression', 'JSXSpreadChild'],
|
|
41
|
+
offsetTernaryExpressions: true
|
|
42
|
+
}],
|
|
43
|
+
'@stylistic/key-spacing': ['error', { beforeColon: false, afterColon: true }],
|
|
44
|
+
'@stylistic/keyword-spacing': ['error', { before: true, after: true }],
|
|
45
|
+
'@stylistic/lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
|
|
46
|
+
'@stylistic/multiline-ternary': ['error', 'always-multiline'],
|
|
47
|
+
'@stylistic/new-parens': 'error',
|
|
48
|
+
'@stylistic/no-extra-parens': ['error', 'functions'],
|
|
49
|
+
'@stylistic/no-floating-decimal': 'error',
|
|
50
|
+
'@stylistic/no-mixed-operators': ['error', {
|
|
51
|
+
groups: [
|
|
52
|
+
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
|
|
53
|
+
['&&', '||'],
|
|
54
|
+
['in', 'instanceof']
|
|
55
|
+
],
|
|
56
|
+
allowSamePrecedence: true
|
|
57
|
+
}],
|
|
58
|
+
'@stylistic/no-mixed-spaces-and-tabs': 'error',
|
|
59
|
+
'@stylistic/no-multi-spaces': 'error',
|
|
60
|
+
'@stylistic/no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
|
|
61
|
+
'@stylistic/no-tabs': 'error',
|
|
62
|
+
'@stylistic/no-trailing-spaces': 'error',
|
|
63
|
+
'@stylistic/no-whitespace-before-property': 'error',
|
|
64
|
+
'@stylistic/object-curly-newline': ['error', { multiline: true, consistent: true }],
|
|
65
|
+
'@stylistic/object-curly-spacing': ['error', 'always'],
|
|
66
|
+
'@stylistic/object-property-newline': ['error', { allowMultiplePropertiesPerLine: true }],
|
|
67
|
+
'@stylistic/operator-linebreak': ['error', 'after', { overrides: { '?': 'before', ':': 'before', '|>': 'before' } }],
|
|
68
|
+
'@stylistic/padded-blocks': ['error', { blocks: 'never', switches: 'never', classes: 'never' }],
|
|
69
|
+
'@stylistic/quote-props': ['error', 'as-needed'],
|
|
70
|
+
'@stylistic/quotes': ['error', 'single', { avoidEscape: true, allowTemplateLiterals: false }],
|
|
71
|
+
'@stylistic/rest-spread-spacing': ['error', 'never'],
|
|
72
|
+
'@stylistic/semi': ['error', 'never'],
|
|
73
|
+
'@stylistic/semi-spacing': ['error', { before: false, after: true }],
|
|
74
|
+
'@stylistic/space-before-blocks': ['error', 'always'],
|
|
75
|
+
'@stylistic/space-before-function-paren': ['error', 'always'],
|
|
76
|
+
'@stylistic/space-in-parens': ['error', 'never'],
|
|
77
|
+
'@stylistic/space-infix-ops': 'error',
|
|
78
|
+
'@stylistic/space-unary-ops': ['error', { words: true, nonwords: false }],
|
|
79
|
+
'@stylistic/spaced-comment': ['error', 'always', {
|
|
80
|
+
line: { markers: ['*package', '!', '/', ',', '='] },
|
|
81
|
+
block: { balanced: true, markers: ['*package', '!', ',', ':', '::', 'flow-include'], exceptions: ['*'] }
|
|
82
|
+
}],
|
|
83
|
+
'@stylistic/template-curly-spacing': ['error', 'never'],
|
|
84
|
+
'@stylistic/template-tag-spacing': ['error', 'never'],
|
|
85
|
+
'@stylistic/wrap-iife': ['error', 'any', { functionPrototypeMethods: true }],
|
|
86
|
+
'@stylistic/yield-star-spacing': ['error', 'both']
|
|
87
|
+
}
|
|
88
|
+
}
|
package/index.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import standard from './config/standard.mjs'
|
|
2
|
+
import stylistic from './config/stylistic.mjs'
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
{
|
|
6
|
+
name: '@sequencemedia/eslint-config-standard',
|
|
7
|
+
languageOptions: {
|
|
8
|
+
ecmaVersion: 'latest'
|
|
9
|
+
},
|
|
10
|
+
files: [
|
|
11
|
+
'**/*.{mjs,cjs}'
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
standard,
|
|
15
|
+
stylistic
|
|
16
|
+
]
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sequencemedia/eslint-config-standard",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Standard configuration for ESLint 9",
|
|
5
|
+
"main": "./index.mjs",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Jonathan Perry for Sequence Media Limited",
|
|
9
|
+
"email": "sequencemedia@sequencemedia.net",
|
|
10
|
+
"url": "https://sequencemedia.net"
|
|
11
|
+
},
|
|
12
|
+
"license": "ISC",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+ssh://git@github.com/sequencemedia/eslint-config-standard.git"
|
|
16
|
+
},
|
|
17
|
+
"homepage": "https://github.com/sequencemedia/eslint-config-standard#readme",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/sequencemedia/eslint-config-standard/issues"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"lint": "eslint .",
|
|
23
|
+
"lint:fix": "npm run lint -- --fix",
|
|
24
|
+
"prepare": "husky"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@stylistic/eslint-plugin": "^2.3.0",
|
|
28
|
+
"eslint-plugin-n": "^17.9.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"eslint": "^9.6.0",
|
|
32
|
+
"@sequencemedia/hooks": "^1.0.495",
|
|
33
|
+
"husky": "^9.0.11"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"eslint": ">=9"
|
|
37
|
+
},
|
|
38
|
+
"imports": {
|
|
39
|
+
"#eslint-config-standard": "./index.mjs"
|
|
40
|
+
},
|
|
41
|
+
"exports": {
|
|
42
|
+
".": "./index.mjs",
|
|
43
|
+
"./config/*": "./config/*.mjs"
|
|
44
|
+
}
|
|
45
|
+
}
|