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: ['carbon-base'],
|
19 | plugins: ['jsdoc'],
|
20 | rules: {
|
21 | 'jsdoc/check-param-names': 2,
|
22 | 'jsdoc/check-tag-names': 2,
|
23 | 'jsdoc/check-types': 2,
|
24 | 'comma-dangle': [
|
25 | 2,
|
26 | {
|
27 | arrays: 'always-multiline',
|
28 | objects: 'always-multiline',
|
29 | imports: 'always-multiline',
|
30 | exports: 'always-multiline',
|
31 | functions: 'never',
|
32 | },
|
33 | ],
|
34 | 'class-methods-use-this': 0,
|
35 | 'max-len': [2, 130, 4],
|
36 | 'no-plusplus': 0,
|
37 | 'no-restricted-globals': ['error', 'isFinite'].concat(restrictedGlobals),
|
38 | 'no-underscore-dangle': [2, { allowAfterThis: true, allowAfterSuper: true }],
|
39 | },
|
40 | settings: {
|
41 | jsdoc: {
|
42 | tagNamePreference: {
|
43 | augments: 'extends',
|
44 | },
|
45 | },
|
46 | },
|
47 | overrides: [
|
48 | {
|
49 | files: ['**/*.config.js'],
|
50 | parserOptions: {
|
51 | sourceType: 'script',
|
52 | },
|
53 | env: {
|
54 | browser: false,
|
55 | },
|
56 | },
|
57 | {
|
58 | files: ['**/__tests__/**'],
|
59 | env: {
|
60 | jest: true,
|
61 | },
|
62 | rules: {
|
63 | 'no-restricted-syntax': [2, { selector: 'LabeledStatement' }, { selector: 'WithStatement' }],
|
64 | },
|
65 | },
|
66 | ],
|
67 | };
|