Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add static code analysis #1970

Merged
merged 30 commits into from
May 13, 2019
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
159 changes: 159 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
env:
browser: true
es6: true
jest: true
extends:
- eslint:recommended
globals:
React: readonly
parserOptions:
ecmaFeatures:
jsx: true
ecmaVersion: 10
sourceType: module
rules:
# Only list rules that are not in *:recommended set
# If rules are set to disable the one in *:recommended, please elaborate the reason
no-async-promise-executor: error
no-await-in-loop: error
no-console:
- error
- allow:
- error
- warn
no-extra-parens: error
no-misleading-character-class: error
no-template-curly-in-string: error
require-atomic-updates: error
accessor-pairs: error
block-scoped-var: error
class-methods-use-this:
- error
- exceptMethods:
- render
# Re-enable later
# complexity:
# - error
# - 5
curly: error
default-case: error
dot-notation: error
eqeqeq: error
max-classes-per-file:
- error
- 2
no-alert: error
no-caller: error
no-div-regex: error
no-else-return: error
no-empty-function: error
no-eq-null: error
no-eval: error
no-extend-native: error
no-extra-bind: error
no-extra-label: error
no-implicit-globals: error
no-implied-eval: error
no-invalid-this: error
no-iterator: error
no-labels: error
no-lone-blocks: error
# Re-enable later
# no-magic-numbers: error
no-multi-spaces:
- error
- ignoreEOLComments: true
no-multi-str: error
no-new: error
no-new-func: error
no-new-wrappers: error
no-octal-escape: error
no-proto: error
no-return-assign: error
no-return-await: error
no-script-url: error
no-self-compare: error
no-sequences: error
no-throw-literal: error
no-unmodified-loop-condition: error
no-unused-expressions:
compulim marked this conversation as resolved.
Show resolved Hide resolved
- error
- allowShortCircuit: true
allowTernary: true
no-useless-call: error
no-useless-catch: error
no-useless-concat: error
no-useless-return: error
no-void: error
no-with: error
prefer-promise-reject-errors: error
radix: error
require-await: error
require-unicode-regexp: error
wrap-iife: error
yoda: error
no-label-var: error
compulim marked this conversation as resolved.
Show resolved Hide resolved
# Re-enable later
# no-shadow:
# - error
# - builtinGlobals: true
# hoist: all
no-shadow-restricted-names: error
no-undef-init: error
no-undefined: error
no-unused-vars:
- error
- argsIgnorePattern: ^_$
varsIgnorePattern: ^_
no-use-before-define: error
callback-return: error
global-require: error
handle-callback-err: error
no-buffer-constructor: error
no-mixed-requires: error
no-new-require: error
no-path-concat: error
no-sync: error
arrow-body-style:
compulim marked this conversation as resolved.
Show resolved Hide resolved
- error
- as-needed
arrow-parens:
- error
- as-needed
arrow-spacing:
- error
- after: true
before: true
generator-star-spacing:
- error
- after
# no-confusing-arrow: // Will produce shorter code if allowed
# - error
# - allowParens: true // This will conflict with no-extra-parens
no-duplicate-imports: error
no-useless-computed-key: error
no-useless-constructor: error
no-useless-rename: error
no-var: error
object-shorthand: error
prefer-arrow-callback: error
prefer-const: error
prefer-destructuring: error
prefer-rest-params: error
prefer-spread: error
# prefer-template: error // This will force, a + '', into, `${ a }`, which increase code length
rest-spread-spacing:
- error
- never
# sort-imports: // Cannot group global or local imports and sort in differently
# - error
# - ignoreCase: true
template-curly-spacing:
- error
- always
yield-star-spacing:
- error
- after
settings:
react:
version: detect
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Added something, by [@johndoe](https://github.com/johndoe), in PR [#XXX](https://github.com/Microsoft/BotFramework-WebChat/pull/XXX)
-->

### Added
- `*`: Added [`eslint`](https://npmjs.com/package/eslint/) to static code analysis, by [@compulim](https://github.com/compulim), in PR [#1970](https://github.com/microsoft/BotFramework-WebChat/pull/1970)

### Changed
- `*`: Bump to:
- [`lerna@3.13.4`](https://npmjs.com/package/lerna/),
Expand Down
Loading