Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

eslint-config-appnexus

appnexus1.1k7.1.2

AppNexus Standard Eslint Config

AppNexus, config, eslint, eslintconfig, javascript, styleguide

readme

eslint-config-appnexus

Installation

npm install eslint-config-appnexus --save-dev

# Additional plugins needed
npm install eslint-plugin-import --save-dev
npm install eslint-plugin-lodash --save-dev
npm install eslint-plugin-promise --save-dev
npm install eslint-plugin-prettier --save-dev
npm install --save-dev --save-exact prettier

Create a .prettierrc file in the project root with the standard overrides:

{
  "printWidth": 120,
  "singleQuote": true,
  "arrowParens": "always",
  "semi": true,
  "trailingComma": "all"
}

Configure .eslintrc.json

Base

View Config

{
    "extends": ["appnexus"]
}

Base + UI Rules

View Config

{
    "extends": ["appnexus/frontend"]
}

Additional installs

npm install eslint-plugin-react --save-dev

Base + Backend Rules

View Config

{
    "extends": ["appnexus/backend"]
}

Additional installs

npm install eslint-plugin-hapi --save-dev

Typescript Base

View Config

{
    "extends": ["appnexus/typescript"]
}

Additional installs

npm install @typescript-eslint/eslint-plugin@latest --save-dev
npm install eslint-plugin-import@latest --save-dev

package.json scripts:

    "lint": "eslint --ext .js,.jsx,.ts,.tsx src",
    "lint-fix": "eslint --ext .js,.jsx,.ts,.tsx src --fix",

Overriding rules

To override rules for your project use the rules section of the .eslintrc.json file

Example overriding indentation to 2 spaces:

{
    "extends": ["appnexus"],
    "rules": {
        "indent": ["error", 2]
    }
}

Example of adding mocha defined functions:

{
    "env": {
        "mocha": true
    },
    "extends": ["appnexus"]
}

Rule Changes

See the wiki for the semver policy for this project. Please propose rule changes as an issue in this repo.

Find Unused Rules

npm run find-unused-rules -- base.js
npm run find-unused-rules -- frontend.js
npm run find-unused-rules -- backend.js

changelog

Change Log

Latest

7.1.1

  • [patch] - Excluded __html from @typescript-eslint/naming-convention

7.1.0

  • [minor] - This creates a new rule for enums and enum props

7.0.1

  • [patch] - Fixed a typo in the rule name

7.0.0

  • [major] - Updated the warns to errors and added new rules to account for the latest ts parse. Also updated ts parsers

6.2.0

  • [minor] - Updated dependencies and fixed lint

6.1.0

  • [minor] - Added @typescript-eslint/naming-convention with warnings
  • [patch] - Removed @typescript-eslint/camelcase
  • [patch] - Turned no-use-before-define off
  • [patch] - Turned react/jsx-sort-props off
  • [patch] - Turned @typescript-eslint/no-unsafe-member-access off
  • [patch] - Turned @typescript-eslint/no-use-before-define off
  • [patch] - Turned @typescript-eslint/restrict-plus-operands off
  • [patch] - Turned @typescript-eslint/no-unsafe-assignment off
  • [patch] - Replaced interface-name-prefix with naming-convention

6.0.0

  • [major] - Updated typescript to 4, the next major version

5.0.0

  • [major] - Moved temp warnings over to Errors for FE

4.1.0

  • [minor] - Adding 2 rules for FE

4.0.0

  • [patch] - Moving our warnings over to errors

3.1.2

  • [patch] - Adding new warnings prior to a major bump

3.1.1

  • [patch] - Updated dependencies

3.1.0

  • [minor] - Added appnexus/typescript
  • [patch] - Changed promise/always-return from error to off

3.0.1

  • [patch] - Dependency updates

3.0.0

  • [minor] - Frontend: promise/always-return no longer errors
  • [minor] - no-console allows warn, info, error
  • [major] - Added prettier and rules as warning

2.0.2

  • [patch] - fixed experimentalObjectRestSpread error

2.0.0

  • [major] - Upgraded dependencies
  • [major] - warning promoted to errors

1.6.0

  • [minor] - Added warning for no-undef to become error in next major release
  • [minor] - Added warning for jsx-quotes to become error in next major release
  • [minor] - Added warning for react/prop-types to become error in next major release

1.5.1

  • Removed peerDependencies

1.5.0

  • [minor] - Added js and jsx extensions to import/resolver settings in frontend

1.4.0

  • [minor] - Removed quote-props lint rule

1.3.0

  • [minor] - Changed quote-props to 'consistent-as-needed'
  • [patch] - Allow indentation for case statements

1.2.0

  • [minor] - Added warning for quote-props to become error in next major release

1.1.0

  • Added Changelog
  • [minor] - Dropping space-infix-ops rule for now
  • [minor] - Removed unused promise/no-native
  • [minor] - Removed no-else-return
  • [minor] - Added warnings for rules added by eslint:recommend to become errors in next major release
  • Now inherits from eslint:recommend

1.0.2

  • First official release