Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
67 lines (61 loc) · 1.77 KB
/
Copy patheslint.config.js
File metadata and controls
67 lines (61 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
'use strict';
// This is a good example file to copy:
// https://gerrit.wikimedia.org/r/c/mediawiki/extensions/CheckUser/+/1371784/1/eslint.config.js
const { defineConfig, globalIgnores } = require( 'eslint/config' );
const globals = require( 'globals' );
const wikimedia = require( 'eslint-config-wikimedia/flat' );
module.exports = defineConfig( [
// js, json, and yml are linted by default. Other file types are not linted by default.
globalIgnores( [
'=*/',
'**/coverage/',
'**/dist/',
'**/jsconfig.json',
'**/tsconfig.json',
'**/package.json',
'**/package-lock.json',
'test.js',
'test2.js'
] ),
{
ignores: [ 'eslint.config.js' ],
extends: [ wikimedia( 'client', 'jquery', 'mediawiki' ) ],
languageOptions: {
ecmaVersion: 2024,
globals: {
// From `env: { jest: true }`
...globals.jest,
mediaWiki: 'readonly'
},
sourceType: 'module'
},
rules: {
// Default rules we don't like
'compat/compat': 'off',
'es-x/no-class-fields': 'off',
'es-x/no-string-prototype-matchall': 'off',
'es-x/no-string-prototype-replaceall': 'off',
'jsdoc/require-param': 'off',
'jsdoc/require-param-type': 'off',
'jsdoc/require-returns': 'off',
'max-len': 'off',
'mediawiki/class-doc': 'off',
'no-alert': 'off',
'no-console': 'off',
'no-jquery/no-class-state': 'off',
'no-jquery/no-extend': 'off',
'no-jquery/no-global-selector': 'off',
'no-jquery/no-parse-html-literal': 'off',
'no-shadow': 'off',
'no-underscore-dangle': 'off',
'security/detect-non-literal-regexp': 'off',
'security/detect-unsafe-regex': 'off',
// Non-default rules we do like
'no-nested-ternary': 'error',
// Rules we should probably fix someday
camelcase: 'off',
eqeqeq: 'off',
'jsdoc/check-param-names': 'off'
}
}
] );