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