UNPKG

7.7 kBJavaScriptView Raw
1module.exports = {
2 'env': {
3 'es6': true
4 },
5 'parserOptions': {
6 'ecmaVersion': 6,
7 'sourceType': 'module',
8 'ecmaFeatures': {
9 'generators': false,
10 'objectLiteralDuplicateProperties': false
11 }
12 },
13 'plugins': [
14 'import'
15 ],
16 'rules': {
17 // enforces no braces where they can be omitted
18 // http://eslint.org/docs/rules/arrow-body-style
19 'arrow-body-style': [2, 'as-needed'],
20 // require parens in arrow function arguments
21 'arrow-parens': 0,
22 // require space before/after arrow function's arrow
23 // http://eslint.org/docs/rules/arrow-spacing
24 'arrow-spacing': [2, { 'before': true, 'after': true }],
25 // require trailing commas in multiline object literals
26 'comma-dangle': [2, 'always-multiline'],
27 // verify super() callings in constructors
28 'constructor-super': 0,
29 // enforce the spacing around the * in generator functions
30 'generator-star-spacing': 0,
31 // disallow modifying variables of class declarations
32 // http://eslint.org/docs/rules/no-class-assign
33 'no-class-assign': 2,
34 // disallow arrow functions where they could be confused with comparisons
35 // http://eslint.org/docs/rules/no-confusing-arrow
36 'no-confusing-arrow': [2, {
37 'allowParens': true,
38 }],
39 // disallow modifying variables that are declared using const
40 'no-const-assign': 2,
41 // disallow duplicate class members
42 // http://eslint.org/docs/rules/no-dupe-class-members
43 'no-dupe-class-members': 2,
44 // disallow importing from the same path more than once
45 // http://eslint.org/docs/rules/no-duplicate-imports
46 'no-duplicate-imports': 2,
47 // disallow symbol constructor
48 // http://eslint.org/docs/rules/no-new-symbol
49 'no-new-symbol': 2,
50 // disallow specific globals
51 'no-restricted-globals': 0,
52 // disallow specific imports
53 // http://eslint.org/docs/rules/no-restricted-imports
54 'no-restricted-imports': 0,
55 // disallow to use this/super before super() calling in constructors.
56 'no-this-before-super': 0,
57 // require let or const instead of var
58 'no-var': 2,
59 // disallow useless computed property keys
60 // http://eslint.org/docs/rules/no-useless-computed-key
61 'no-useless-computed-key': 2,
62 // disallow unnecessary constructor
63 // http://eslint.org/docs/rules/no-useless-constructor
64 'no-useless-constructor': 2,
65 // require method and property shorthand syntax for object literals
66 // http://eslint.org/docs/rules/object-shorthand
67 'object-shorthand': [2, 'always'],
68 // suggest using arrow functions as callbacks
69 'prefer-arrow-callback': [2, {
70 'allowNamedFunctions': false,
71 'allowUnboundThis': true,
72 }],
73 // suggest using of const declaration for variables that are never modified after declared
74 'prefer-const': 2,
75 // suggest using the spread operator instead of .apply()
76 'prefer-spread': 0,
77 // suggest using Reflect methods where applicable
78 'prefer-reflect': 0,
79 // use rest parameters instead of arguments
80 // http://eslint.org/docs/rules/prefer-rest-params
81 'prefer-rest-params': 2,
82 // suggest using template literals instead of string concatenation
83 // http://eslint.org/docs/rules/prefer-template
84 'prefer-template': 2,
85 // disallow generator functions that do not have yield
86 'require-yield': 0,
87 // import sorting
88 // http://eslint.org/docs/rules/sort-imports
89 'sort-imports': 0,
90 // enforce usage of spacing in template strings
91 // http://eslint.org/docs/rules/template-curly-spacing
92 'template-curly-spacing': 2,
93 // enforce spacing around the * in yield* expressions
94 // http://eslint.org/docs/rules/yield-star-spacing
95 'yield-star-spacing': [2, 'after'],
96 // disallow invalid exports, e.g. multiple defaults
97 // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/export.md
98 'import/export': 2,
99 // ensure default import coupled with default export
100 // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/default.md#when-not-to-use-it
101 'import/default': 0,
102 // Ensure consistent use of file extension within the import path
103 // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md
104 // TODO: enable
105 'import/extensions': [0, 'never'],
106 // ensure named imports coupled with named exports
107 // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/named.md#when-not-to-use-it
108 'import/named': 0,
109 // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/namespace.md
110 'import/namespace': 0,
111 // Forbid the use of extraneous packages
112 // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
113 // TODO: enable
114 'import/no-extraneous-dependencies': [0, {
115 'devDependencies': false,
116 'optionalDependencies': false,
117 }],
118 // ensure imports point to files/modules that can be resolved
119 // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
120 'import/no-unresolved': [2, { 'commonjs': true }],
121 // do not allow a default import name to match a named export
122 // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-named-as-default.md
123 // TODO: enable
124 'import/no-named-as-default': 0,
125 // disallow require()
126 // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-commonjs.md
127 'import/no-commonjs': 0,
128 // disallow AMD require/define
129 // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-amd.md
130 'import/no-amd': 2,
131 // disallow non-import statements appearing before import statements
132 // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/imports-first.md
133 // TODO: enable?
134 'import/imports-first': [0, 'absolute-first'],
135 // disallow duplicate imports
136 // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md
137 'import/no-duplicates': 2,
138 // disallow use of jsdoc-marked-deprecated imports
139 // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-deprecated.md
140 'import/no-deprecated': 0,
141 // disallow namespace imports
142 // TODO: enable?
143 // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-namespace.md
144 'import/no-namespace': 0,
145 // warn on accessing default export property names that are also named exports
146 // TODO: enable?
147 // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-named-as-default-member.md
148 'import/no-named-as-default-member': 0,
149 // No Node.js builtin modules
150 // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-nodejs-modules.md
151 'import/no-nodejs-modules': 0,
152 // Enforce a convention in module import order
153 // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md
154 // TODO: enable?
155 'import/order': [0, {
156 'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
157 'newlines-between': 'never',
158 }],
159 // Require a newline after the last import/require in a group
160 // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/newline-after-import.md
161 // TODO: enable
162 'import/newline-after-import': 0,
163 // Forbid mutable exports
164 // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-mutable-exports.md
165 'import/no-mutable-exports': 2,
166 },
167 'settings': {
168 'import/resolver': {
169 'node': {
170 'extensions': ['.js', '.json']
171 }
172 }
173 }
174};