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

Package detail

@cerner/eslint-config-terra

cerner712Apache-2.05.6.0

Terra Eslint Config

eslint, eslint-config, Cerner, Terra

readme

Eslint Config Terra

NPM version Build Status

Terra's sharable ESLint configuration for their UI library and build tools.

Features:

  • extends the eslint-config-airbnb, which exports ESLint rules, including rules for ECMAScript 6+ and React.
  • checks for proper ReactJS Hooks usage via the eslint-plugin-react-hooks.
  • checks syntax for targeted browsers support via the eslint-plugin-compat. It is recommended to use Terra's targeted browsers which are specified by the browserslist-config-terra module.
  • defines the browser and jest environment
  • defines enzyme globals for shallow, render and mount for jest testing

What is Eslint

ESlint is a pluggable linting utility for JavaScript and JSX.

Installation

Install the module

npm install eslint --save-dev
npm install @cerner/eslint-config-terra --save-dev

Usage

First, include the configuration defined by @cerner/eslint-config-terra via the extends property.

Then, define the browsers for the eslint-plugin-compat plugin to target by add the browsers list configuration in your package.json through the browserslist key.

package.json

{
  "browserslist": [
    "extends @cerner/browserslist-config-terra"
  ],
  "eslintConfig": {
    "extends": "@cerner/terra"
  },
}

Node version support

This package was developed and tested using Node 10 up to Node 14. Consumers using Node 16 or greater are advised to use it at their own risk since those versions are not officially supported due to lack of thorough testing.

Versioning

eslint-config-terra is considered to be stable and will follow SemVer for versioning.

  1. MAJOR versions represent breaking changes
  2. MINOR versions represent added functionality in a backwards-compatible manner
  3. PATCH versions represent backwards-compatible bug fixes

Consult the component CHANGELOGs, related issues, and PRs for more information.

LICENSE

Copyright 2018 - present Cerner Innovation, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

changelog

Changelog

Unreleased

5.6.0 - (August 31, 2023)

  • Changed
    • Locked eslint-plugin-formatjs to 2.19.1 so that the version of its peerDependency eslint@7 matches that in eslint-config-terra.

5.5.1 - (August 30, 2023)

  • Fixed
    • Moved eslint from dependencies to the correct peerDependencies section to fix npm 6 install errors.

5.5.0 - (August 24, 2023)

  • Changed
    • Minor dependency version bump

5.4.0 - (February 11, 2022)

  • Changed
    • Revert limiting upper Node version to 14.

5.3.0 - (February 8, 2022)

  • Changed
    • Updated component to support Node 14.

5.2.0 - (November 16, 2021)

  • Changed
    • Add Format-js linter.

5.1.0 - (April 23, 2021)

  • Changed
    • Added FullStack to globals for usage in full stack testing

5.0.0 - (February 16, 2021)

  • Breaking
    • Update to eslint ^7.19.0.

4.5.1 - (February 9, 2021)

  • Fixed
    • Locking into a previous version of eslint-config-airbnb is non passive, rolling back the fix for the missing peer.

4.5.0 - (February 8, 2021)

  • Fixed
    • Resolved missing peer dependency warning by locking into a previous version of eslint-config-airbnb.

4.4.0 - (January 27, 2021)

  • Changed
    • Added $ to globals for usage in WDIO spec tests

4.3.0 - (January 5, 2021)

  • Changed
    • Opened the node version to allow versions higher than node 10.

4.2.0 - (November 24, 2020)

  • Fixed

    • The badges in the readme were pointing to an incorrect url.
  • Changed

    • Updated eslint config file to use off, warn and error instead of 0, 1 and 2.

4.1.0 - (August 4, 2020)

  • Added
    • babel-eslint as parser to allow current js functionality, like optional chaining.

4.0.0 - (May 5, 2020)

  • Breaking Change
    • Updated to a scoped packages: @cerner/eslint-config-terra

3.3.0 - (January 28, 2020)

  • Changed

    • Update copyright to include 2020
  • Added

    • Added new override for relative package imports within terra-dev-site example files

3.2.0 - (November 7, 2019)

  • Added
    • Added minimum node engine version of 8.10.0, 10.13.0, or 11.10.1 in package.json

3.1.0 - (October 30, 2019)

  • Added
    • Added rule override for no-multiple-empty-lines to warn on multiple consecutive empty lines

3.0.2 - (October 1, 2019)

  • Changed
    • Pin eslint-plugin-react dependency to 7.14.3

3.0.1 - (September 6, 2019)

  • Changed
    • Update eslint-plugin-react-hooks dependency to ^2.0.1

3.0.0 - (August 20, 2019)

  • Breaking Change

    • Updated eslint peer dependency to ^6.1.0
    • Update eslint-config-airbnb dependency to ^18.0.0
    • Update eslint-plugin-compat dependency to ^3.3.0
    • Enable react/jsx-wrap-multilines rule
    • Updating warning for style prop to produce an error instead of a warning
  • Changed

    • Replace DangerJS integration with probot-changelog
    • Removed rimraf devDependency and replaced with rm -rf

2.5.0 - (May 9, 2019)

  • Added
    • A warning to discourage inline styles

2.4.0 - (February 11, 2019)

  • Added
    • Setting to eslint-plugin-compat config to denote polyfill usage for Object.values.

2.3.0 - (February 6, 2019)

  • Added

    • React Hooks plugin and rules
  • Changed

    • Unlocked 'eslint-plugin-react' to ^7.12.2
    • Updated config rules to make react/jsx-wrap-multilines a warning for passivity

2.2.0 - (January 2, 2019)

  • Added

    • Rule override to turn off the no-unused-expression rule for jest or wdio test files.
  • Changed

    • Added after as globals for test files recursively under a "wdio" directory
    • Tempararily lock-down eslint-plugin-react. V7.12.0 was released with bugs and has not yet been fixed. Locking this down until a fix is released.

2.1.0 - (August 29, 2018)

  • Changed
    • Updated mount, shallow, and render to only be globals for test files recursively under a "jest" directory
    • Added before, browser, and Terra as globals for test files recursively under a "wdio" directory

2.0.0 - (August 23, 2018)

  • Changed
    • Update ESLint and related dependencies to ESLint v5 compatible versions
    • Disabled the deprecated jsx-a11y/label-has-for rule. More info about this rule deprecation here: https://github.com/evcohen/eslint-plugin-jsx-a11y/releases/tag/v6.1.0
    • Replaced jsx-a11y/label-has-for rule with new jsx-a11y/label-has-associated-control rule
    • Disabled react/destructuring-assignment rule

1.1.0 - (July 11, 2018)

  • Changed
    • Updated 'jsx-a11y/label-has-for' to require id or nested input for label mapping

1.0.1 - (June 19, 2018)

  • Changed
    • Minor update to ReadMe

1.0.0 - (June 18, 2018)

  • Initial stable release
    • Updated to ensure travis builds successfully