1 | 'use strict';
|
2 |
|
3 | const restrictedGlobals = require('eslint-restricted-globals');
|
4 |
|
5 | module.exports = {
|
6 | root: true,
|
7 | parser: 'babel-eslint',
|
8 | parserOptions: {
|
9 | sourceType: 'module',
|
10 | },
|
11 | env: {
|
12 | browser: true,
|
13 | es6: true,
|
14 | },
|
15 | globals: {
|
16 | __DEV__: true,
|
17 | },
|
18 | extends: ['eslint-config-carbon/vanilla'],
|
19 | plugins: ['jsdoc'],
|
20 | rules: {
|
21 | 'jsdoc/check-param-names': 2,
|
22 | 'jsdoc/check-tag-names': [
|
23 | 'error',
|
24 | {
|
25 | definedTags: ['jest-environment'],
|
26 | },
|
27 | ],
|
28 | 'jsdoc/check-types': 2,
|
29 | 'comma-dangle': [
|
30 | 2,
|
31 | {
|
32 | arrays: 'always-multiline',
|
33 | objects: 'always-multiline',
|
34 | imports: 'always-multiline',
|
35 | exports: 'always-multiline',
|
36 | functions: 'never',
|
37 | },
|
38 | ],
|
39 | 'class-methods-use-this': 0,
|
40 | 'max-len': [2, 130, 4],
|
41 | 'no-plusplus': 0,
|
42 | 'no-restricted-globals': ['error', 'isFinite'].concat(restrictedGlobals),
|
43 | 'no-underscore-dangle': [
|
44 | 2,
|
45 | { allowAfterThis: true, allowAfterSuper: true },
|
46 | ],
|
47 | strict: ['error', 'global'],
|
48 | },
|
49 | settings: {
|
50 | jsdoc: {
|
51 | tagNamePreference: {
|
52 | augments: 'extends',
|
53 | },
|
54 | },
|
55 | },
|
56 | overrides: [
|
57 | {
|
58 | files: ['**/*.config.js'],
|
59 | parserOptions: {
|
60 | sourceType: 'script',
|
61 | },
|
62 | env: {
|
63 | browser: false,
|
64 | },
|
65 | },
|
66 | {
|
67 | files: ['**/__tests__/**'],
|
68 | env: {
|
69 | jest: true,
|
70 | },
|
71 | rules: {
|
72 | 'no-restricted-syntax': [
|
73 | 2,
|
74 | { selector: 'LabeledStatement' },
|
75 | { selector: 'WithStatement' },
|
76 | ],
|
77 | },
|
78 | },
|
79 | ],
|
80 | };
|