Using ESLint

While DeepScan is focusing on the capability beyond lint, many users still want to use ESLint for checking code styles and by its useful plugins.

Now you can analyze your projects with both DeepScan and ESLint and see the results altogether from our dashboard.

ESLint Analysis

DeepScan provides ESLint analysis to help organizations using ESLint manage the results of both tools. After DeepScan has finished its own analysis, it runs ESLint v5.16 and aggregates the result by both tools.

Although the ESLint analysis fails by any reasons, you can see the analysis results of DeepScan without an interruption.

Enable ESLint Analysis

By default, ESLint analysis is disabled. To enable it, do the following:

  • Navigate to the project settings
  • Check on the Enable ESLint option
  • When you are asked whether or to reanalyze, click Reanalyze button
ESLint settings

Options

Merge Options

DeepScan and ESLint rules can be duplicated such as BAD_TYPEOF_COMPARISON and valid-type-of, so the option to merge these issues is provided.

In the project settings, you can choose how the identical issues are merged. Default is Prefer DeepScan rule.

  • Prefer DeepScan rule: Show only DeepScan issue (e.g., BAD_TYPEOF_COMPARISON)
  • Prefer ESLint rule: Show only ESLint issue (e.g., valid-type-of)
  • Do not merge: Show all issues as is (e.g., BAD_TYPEOF_COMPARISON and valid-type-of)

File Extensions

You can specify file extensions for the ESLint --ext option.

--ext option allows you to specify which file extensions ESLint will use when searching for JavaScript files. For example, if you have only TypeScript files, you need to specify .ts.

Or you can specify comma-separated format such as .js,.ts to analyze both JavaScript and TypeScript files.

View Issues

In the Issues view, you can see the issues detected by both tools.

If you want to view only the ESLint issues, check ESLint checkbox solely in the left engines filter. Also, you can navigate to the document page by clicking a rule name.

ESLint Issues

Supported Plugins

DeepScan runs ESLint within a Docker container. For security concerns due to executing code, only a predefined set of ESLint plugins are supported:

@react-native-community/eslint-config
@storybook/eslint-config-storybook
@typescript-eslint/eslint-plugin
@typescript-eslint/parser
@vue/eslint-config-prettier
@vue/eslint-config-typescript
babel-eslint
eslint-config-airbnb
eslint-config-airbnb-base
eslint-config-angular
eslint-config-ember
eslint-config-google
eslint-config-loopback
eslint-config-prettier
eslint-config-react-app
eslint-config-standard
eslint-config-standard-jsx
eslint-config-standard-react
eslint-config-xo-react
eslint-config-xo-space
eslint-import-resolver-node
eslint-import-resolver-webpack
eslint-plugin-babel
eslint-plugin-chai-friendly
eslint-plugin-dependencies
eslint-plugin-eggache
eslint-plugin-ember
eslint-plugin-es
eslint-plugin-eslint-comments
eslint-plugin-filenames
eslint-plugin-flowtype
eslint-plugin-import
eslint-plugin-jasmine
eslint-plugin-jest
eslint-plugin-jsdoc
eslint-plugin-jsx-a11y
eslint-plugin-lodash
eslint-plugin-markdown
eslint-plugin-mocha
eslint-plugin-no-only-tests
eslint-plugin-no-unsafe-innerhtml
eslint-plugin-node
eslint-plugin-prettier
eslint-plugin-promise
eslint-plugin-react
eslint-plugin-react-hooks
eslint-plugin-react-native
eslint-plugin-react-native-globals
eslint-plugin-react-perf
eslint-plugin-react-with-styles
eslint-plugin-redux-saga
eslint-plugin-security
eslint-plugin-sonarjs
eslint-plugin-standard
eslint-plugin-vue
eslint-plugin-you-dont-need-lodash-underscore

If you want additional plugins, contact us at support@deepscan.io.

DeepScan does not run npm install on the project and ESLint is run without node_modules. This may generate false alarms about importing modules. To prevent these false alarms we ignore the following rules:

import/extensions
import/no-restricted-paths
import/no-unresolved
import/no-extraneous-dependencies
import/no-named-as-default
import/namespace
import/named
import/no-absolute-path
import/no-duplicates
import/no-named-as-default-member
import/no-cycle
node/no-hide-code-modules
node/no-missing-require
node/no-missing-import

Limitations

  • Files larger than 3 MB are ignored automatically
  • Each supported plugin is installed with its specific version on our container. If you have an issue or want the latest plugin, contact us at support@deepscan.io. Versions of some popular plugins/dependencies are the following:
    • eslint-plugin-jest: 23.8.1
    • eslint-plugin-mocha: 5.3.0
    • eslint-plugin-node: 9.1.0
    • eslint-plugin-react: 7.13.0
    • eslint-plugin-standard: 4.0.1
    • eslint-plugin-vue: 5.2.3
    • prettier: 2.0.5
    • typescript: 3.5.3