ESLint requires configuration via a .eslintrc.* (for example .eslintrc.yml) configuration file as detailed in ESLint's documentation.
If you don't specify your custom configuration file we use our default below. We suggest to add your own configuration file into your repository root directory to be able to specify your coding and quality standards.
env:
browser: true
es6: true
mocha: true
node: true
parser: "@babel/eslint-parser"
extends:
- "eslint:recommended"
- "plugin:react/recommended"
parserOptions:
ecmaVersion: 2020
sourceType: "module"
ecmaFeatures:
classes: true
jsx: true
rules:
brace-style:
- warn
- 1tbs
camelcase: warn
comma-dangle:
- warn
- always-multiline
comma-style:
- error
- last
complexity:
- error
- 10
curly: warn
eol-last:
- error
- always
id-length: error
max-lines: error
max-params:
- error
- 4
no-duplicate-imports: error
no-eq-null: error
eqeqeq:
- error
- smart
no-eval: error
no-implied-eval: error
no-invalid-this: error
no-shadow: error
no-undefined: error
no-empty-function: warn
no-extend-native: error
no-param-reassign: warn
no-unused-expressions: warn
no-useless-concat: warn
no-label-var: warn
no-use-before-define: error
no-const-assign: error
no-useless-constructor: warn
no-useless-rename: warn
no-warning-comments:
- warn
- location: anywhere
terms:
- todo
- fixme
prefer-promise-reject-errors: error
semi: error
settings:
react:
pragma: React
version: 17.0.1
overrides:
- files: ["*.ts", "*.tsx"]
parser: "@typescript-eslint/parser"
plugins:
- "@typescript-eslint"
extends:
- "eslint:recommended"
- "plugin:@typescript-eslint/recommended"
To get started linting React applications, you can use the following ESLint configuration:
Codeac uses ESLint as the default static analysis tool for TypeScript. You do not need to explicitly enable it in your .codeac.yml file.
If your legacy project still requires TSLint, please refer to the TSLint documentation for instructions on how to manually override the default and keep TSLint active.
Storing generated or third party code in your repository is in general not a good idea. However, sometimes you really need to do this and Codeac got you covered. Usually you don't want to analyze those files so you can place .eslintignore file to the root folder of your repository. This file can contain list of files that are ignored. Take a look on this simple example with jQuery and Bootstrap:
Our ESLint engine currently excludes all plugins except those listed below. This approach ensures that the supported plugins are secure and perform well within our environment. We also prioritize well-maintained plugins that are widely used by the community. Please see the list of supported plugins below:
If you need additional plugins, please share your use case with us at support@codeac.io, and we'll be happy to consider adding them.