-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.cjs
54 lines (50 loc) · 1.43 KB
/
.eslintrc.cjs
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
// eslint-disable-next-line import/no-extraneous-dependencies
const loadIgnorePatterns = require( 'jetpack-js-tools/load-eslint-ignore.js' );
module.exports = {
root: true,
extends: [
require.resolve( 'jetpack-js-tools/eslintrc/base' ),
// @todo: Uncomment this:
// require.resolve( 'jetpack-js-tools/eslintrc/react' ),
require.resolve( 'jetpack-js-tools/eslintrc/wp-eslint-plugin/recommended' ),
],
ignorePatterns: [ '**/stories/*.stories.tsx', ...loadIgnorePatterns( __dirname ) ],
parserOptions: {
tsconfigRootDir: __dirname,
project: [ './tsconfig.json', './tsconfig.eslint.json' ],
},
overrides: [
// .js and .cjs files in the root are not part of the TypeScript project.
{
files: [ '*.js', '*.cjs' ],
parserOptions: {
project: null,
},
},
],
rules: {
// Enforce the use of the jetpack-boost textdomain.
'@wordpress/i18n-text-domain': [
'error',
{
allowedTextDomain: 'jetpack-boost',
},
],
// Apparently, we like dangling commas
'comma-dangle': 0,
'jsdoc/no-undefined-types': [
1,
{
definedTypes: [ 'TemplateVars', 'ErrorSet', 'Readable' ],
},
],
// This is not a react project.
'react-hooks/rules-of-hooks': 0,
'import/no-unresolved': 0,
'import/order': 0,
'no-nested-ternary': 0,
camelcase: 0,
// Boost should just use our standard eslint rulesets, that already does this.
'@typescript-eslint/no-unused-vars': [ 'warn', { argsIgnorePattern: '^_' } ],
},
};