-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #451 from openlayers/modernize
Modernize
- Loading branch information
Showing
16 changed files
with
631 additions
and
475 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
{ | ||
env: { | ||
es6: true | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 6, | ||
sourceType: 'module', | ||
ecmaFeatures: { | ||
generators: false, | ||
objectLiteralDuplicateProperties: false | ||
} | ||
}, | ||
|
||
rules: { | ||
# enforces no braces where they can be omitted | ||
# http://eslint.org/docs/rules/arrow-body-style | ||
'arrow-body-style': ['error', 'as-needed', { | ||
requireReturnForObjectLiteral: true, | ||
}], | ||
|
||
# require parens in arrow function arguments | ||
# http://eslint.org/docs/rules/arrow-parens | ||
'arrow-parens': ['error', 'as-needed', { | ||
requireForBlockBody: true, | ||
}], | ||
|
||
# require space before/after arrow function's arrow | ||
# http://eslint.org/docs/rules/arrow-spacing | ||
'arrow-spacing': ['error', { before: true, after: true }], | ||
|
||
# verify super() callings in constructors | ||
'constructor-super': 'error', | ||
|
||
# enforce the spacing around the * in generator functions | ||
# http://eslint.org/docs/rules/generator-star-spacing | ||
'generator-star-spacing': ['error', { before: false, after: true }], | ||
|
||
# disallow modifying variables of class declarations | ||
# http://eslint.org/docs/rules/no-class-assign | ||
'no-class-assign': 'error', | ||
|
||
# disallow arrow functions where they could be confused with comparisons | ||
# http://eslint.org/docs/rules/no-confusing-arrow | ||
'no-confusing-arrow': ['error', { | ||
allowParens: true, | ||
}], | ||
|
||
# disallow modifying variables that are declared using const | ||
'no-const-assign': 'error', | ||
|
||
# disallow duplicate class members | ||
# http://eslint.org/docs/rules/no-dupe-class-members | ||
'no-dupe-class-members': 'error', | ||
|
||
# disallow importing from the same path more than once | ||
# http://eslint.org/docs/rules/no-duplicate-imports | ||
'no-duplicate-imports': 'error', | ||
|
||
# disallow symbol constructor | ||
# http://eslint.org/docs/rules/no-new-symbol | ||
'no-new-symbol': 'error', | ||
|
||
# disallow specific imports | ||
# http://eslint.org/docs/rules/no-restricted-imports | ||
'no-restricted-imports': 'off', | ||
|
||
# disallow to use this/super before super() calling in constructors. | ||
# http://eslint.org/docs/rules/no-this-before-super | ||
'no-this-before-super': 'error', | ||
|
||
# disallow useless computed property keys | ||
# http://eslint.org/docs/rules/no-useless-computed-key | ||
'no-useless-computed-key': 'error', | ||
|
||
# disallow unnecessary constructor | ||
# http://eslint.org/docs/rules/no-useless-constructor | ||
'no-useless-constructor': 'error', | ||
|
||
# disallow renaming import, export, and destructured assignments to the same name | ||
# http://eslint.org/docs/rules/no-useless-rename | ||
'no-useless-rename': ['error', { | ||
ignoreDestructuring: false, | ||
ignoreImport: false, | ||
ignoreExport: false, | ||
}], | ||
|
||
# require let or const instead of var | ||
'no-var': 'error', | ||
|
||
# require method and property shorthand syntax for object literals | ||
# http://eslint.org/docs/rules/object-shorthand | ||
'object-shorthand': ['error', 'always', { | ||
ignoreConstructors: false, | ||
avoidQuotes: true, | ||
}], | ||
|
||
# suggest using arrow functions as callbacks | ||
'prefer-arrow-callback': ['error', { | ||
allowNamedFunctions: false, | ||
allowUnboundThis: true, | ||
}], | ||
|
||
# suggest using of const declaration for variables that are never modified after declared | ||
'prefer-const': ['error', { | ||
destructuring: 'any', | ||
ignoreReadBeforeAssign: true, | ||
}], | ||
|
||
# disallow parseInt() in favor of binary, octal, and hexadecimal literals | ||
# http://eslint.org/docs/rules/prefer-numeric-literals | ||
'prefer-numeric-literals': 'error', | ||
|
||
# use rest parameters instead of arguments | ||
# http://eslint.org/docs/rules/prefer-rest-params | ||
'prefer-rest-params': 'error', | ||
|
||
# suggest using the spread operator instead of .apply() | ||
# http://eslint.org/docs/rules/prefer-spread | ||
'prefer-spread': 'error', | ||
|
||
# suggest using template literals instead of string concatenation | ||
# http://eslint.org/docs/rules/prefer-template | ||
'prefer-template': 'error', | ||
|
||
# disallow generator functions that do not have yield | ||
# http://eslint.org/docs/rules/require-yield | ||
'require-yield': 'error', | ||
|
||
# enforce spacing between object rest-spread | ||
# http://eslint.org/docs/rules/rest-spread-spacing | ||
'rest-spread-spacing': ['error', 'never'], | ||
|
||
# import sorting | ||
# http://eslint.org/docs/rules/sort-imports | ||
'sort-imports': ['off', { | ||
ignoreCase: false, | ||
ignoreMemberSort: false, | ||
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'], | ||
}], | ||
|
||
# require a Symbol description | ||
# http://eslint.org/docs/rules/symbol-description | ||
'symbol-description': 'error', | ||
|
||
# enforce usage of spacing in template strings | ||
# http://eslint.org/docs/rules/template-curly-spacing | ||
'template-curly-spacing': 'error', | ||
|
||
# enforce spacing around the * in yield* expressions | ||
# http://eslint.org/docs/rules/yield-star-spacing | ||
'yield-star-spacing': ['error', 'after'] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.