Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
seleniumhq
GitHub Repository: seleniumhq/selenium
Path: blob/trunk/javascript/selenium-webdriver/eslint.config.js
2884 views
1
// Licensed to the Software Freedom Conservancy (SFC) under one
2
// or more contributor license agreements. See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership. The SFC licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License. You may obtain a copy of the License at
8
//
9
// http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied. See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
const globals = require('globals')
19
const noOnlyTests = require('eslint-plugin-no-only-tests')
20
const js = require('@eslint/js')
21
const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended')
22
const mochaPlugin = require('eslint-plugin-mocha')
23
const nodePlugin = require('eslint-plugin-n')
24
25
module.exports = [
26
js.configs.recommended,
27
eslintPluginPrettierRecommended,
28
mochaPlugin.configs.flat.recommended,
29
nodePlugin.configs['flat/recommended-script'],
30
{
31
languageOptions: {
32
globals: {
33
mocha: true,
34
es6: true,
35
...globals.node,
36
},
37
parserOptions: {
38
ecmaVersion: 2022,
39
},
40
},
41
files: ['**/*.js', 'lib/http.js'],
42
ignores: ['node_modules/*', 'generator/*', 'devtools/generator/'],
43
plugins: {
44
'no-only-tests': noOnlyTests,
45
},
46
rules: {
47
'no-const-assign': 'error',
48
'no-this-before-super': 'error',
49
'no-undef': 'error',
50
'no-unreachable': 'error',
51
'no-unused-vars': [
52
'error',
53
{
54
varsIgnorePattern: '^_',
55
args: 'all',
56
argsIgnorePattern: '^_',
57
},
58
],
59
'constructor-super': 'error',
60
'valid-typeof': 'error',
61
'no-only-tests/no-only-tests': 'error',
62
'n/no-deprecated-api': ['error'],
63
'n/no-missing-import': ['error'],
64
'n/no-missing-require': ['error'],
65
'n/no-mixed-requires': ['error'],
66
'n/no-new-require': ['error'],
67
'n/no-unpublished-import': ['error'],
68
'n/no-unpublished-require': [
69
'error',
70
{
71
allowModules: [
72
'globals',
73
'@eslint/js',
74
'eslint-plugin-mocha',
75
'eslint-plugin-prettier',
76
'eslint-plugin-n',
77
'eslint-plugin-no-only-tests',
78
],
79
tryExtensions: ['.js'],
80
},
81
],
82
'n/prefer-node-protocol': ['error'],
83
'mocha/no-skipped-tests': ['off'],
84
'mocha/no-mocha-arrows': ['off'],
85
'mocha/no-setup-in-describe': ['off'],
86
'mocha/no-top-level-hooks': ['off'],
87
'mocha/no-sibling-hooks': ['off'],
88
'mocha/no-exports': ['off'],
89
'mocha/no-empty-description': ['off'],
90
'mocha/max-top-level-suites': ['off'],
91
'mocha/consistent-spacing-between-blocks': ['off'],
92
'mocha/no-nested-tests': ['off'],
93
'mocha/no-pending-tests': ['off'],
94
'mocha/no-identical-title': ['off'],
95
'prettier/prettier': [
96
'error',
97
{
98
endOfLine: 'lf',
99
printWidth: 120,
100
semi: false,
101
singleQuote: true,
102
trailingComma: 'all',
103
},
104
],
105
},
106
},
107
]
108
109