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

Package detail

eslint-config-zillow-base

zillow529MIT4.0.0

Zillow's base ESLint config, following our code conventions

eslint, eslintconfig, config, zillow, javascript, code conventions

readme

eslint-config-zillow-base

Zillow's base ESLint config (without React plugins), following our code conventions

npm version Build Status

Usage

To install with all necessary peerDependencies, use install-peerdeps:

npx install-peerdeps --dev eslint-config-zillow-base

All exported configs should be added to your ESlint configuration file extends. For example, in a JSON .eslintrc:

{
  "extends": "zillow-base"
}

"extends": "zillow-base"

Our default export contains all of our ESLint rules, including ECMAScript 6+ and Prettier.

"extends": ["zillow-base", "zillow-base/jest]

Jest-specific rules and environment added to the default export.

"extends": ["zillow-base", "zillow-base/mocha]

Mocha-specific rules and environment added to the default export.

prettier Editor Plugin Integration

Unfortunately, super-useful editor plugins like prettier-atom and prettier-vscode do not load Prettier settings from ESLint config, which is where we load our Prettier options from. To workaround this, add a .prettierrc.js or prettier.config.js file to your repo root with the following content:

module.exports = require('prettier-config-zillow');

Development

Consider adding test cases if you're making complicated rules changes, like anything involving regexes. Perhaps in a distant future, we could use literate programming to structure our README as test cases for our .eslintrc?

You can run tests (from the repo root) with npm test.

You can make sure this module lints with itself using npm run lint (from the repo root).

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

4.0.0 (2020-09-30)

Note: Version bump only for package eslint-config-zillow-base

4.0.0-alpha.2 (2020-09-29)

Bug Fixes

  • errors: Move no-restricted-exports to es6 rules, enable (b9845de)
  • errors: Turn off require-atomic-updates, it is very buggy (abb2346)
  • rules: Turn off default-param-last until it is configurable (c05d872)

Features

BREAKING CHANGES

  • peer: The minimum peer version of eslint is now 7.4.0.

4.0.0-alpha.1 (2020-09-28)

Note: Version bump only for package eslint-config-zillow-base

4.0.0-alpha.0 (2020-09-25)

Features

  • Drop support for Node v8.x (0121df0)
  • peer: Drop support for prettier@1 (64ed709)
  • Remove typescript re-export & peer (284dcdd)
  • Support eslint v7 (6f3e765)
  • Upgrade eslint-plugin-jest to ^24.0.2 (dd3462b)
  • Upgrade eslint-plugin-mocha to ^8.0.0 (127d636)
  • peer: Update minimum version ranges (4dd1ae4)

BREAKING CHANGES

3.8.0 (2020-09-23)

Features

  • base: Add new Jest rules (2b1f25a)
  • base: Add new TypeScript rules (5ab97fc)

3.7.8 (2020-06-03)

Bug Fixes

  • typescript: Use correct prettier options in eslint-plugin-prettier rule (d7562b2)

3.7.7 (2020-05-18)

Bug Fixes

  • typescript: Allow TODO methods, too (b2e5b4e)

3.7.6 (2020-05-18)

Bug Fixes

  • typescript: Allow 'TODO' properties (b534a5e)

3.7.5 (2020-05-16)

Bug Fixes

  • typescript: Allow callbacks in type aliases (aac8344)
  • typescript: Allow function expressions to use PascalCase (409939a)
  • typescript: Allow Next.js context properties to be PascalCase (730fa7d)
  • typescript: Only prevent I- prefix on interfaces, allow acronyms that start with I (a389036)
  • typescript: Turn off no-magic-numbers rule (but flesh out config) (020cd54)

3.7.4 (2020-05-08)

Bug Fixes

  • base: Add typescript peer, docs (f577ee5)

3.7.3 (2020-04-24)

Bug Fixes

  • typescript: Configure explicit-member-accessibility rule to omit public modifiers (201bc36)
  • typescript: Replace deprecated rules with fully-configured naming-convention (e824145)
  • typescript: Turn off react/sort-comp in TSX files, it doesn't cooperate with class properties (46c8ecc)

3.7.2 (2020-04-24)

Bug Fixes

  • typescript: Add missing rule config (89085b1)

3.7.1 (2020-04-23)

Bug Fixes

  • typescript: Add missing entry to pkg.files (03c72d0)

3.7.0 (2020-04-23)

Features

3.6.0 (2020-04-21)

Features

  • Expand peer range of prettier to 2.x (07ddbef)

3.5.0 (2019-10-10)

Features

  • base: Add config for jest/require-top-level-describe (36d46f1)
  • base: Add config for mocha/no-return-from-async (9781e8c)
  • base: Expand peer range of eslint-plugin-mocha to 6.x (ac32540)
  • config: Turn off import/prefer-default-export (#6) (f662ddc)

3.4.0 (2019-08-07)

Features

  • base: Add new eslint-plugin-jest rules (cb7fc1c)

3.3.1 (2019-06-26)

Note: Version bump only for package eslint-config-zillow-base

3.3.0 (2019-06-26)

Features

  • plugin: Bump eslint-plugin-jest (0a795b4)

3.2.0 (2019-04-22)

Bug Fixes

  • base: Add import/no-unused-modules config (486e9f3)

Features

  • base: Consume prettier-config-zillow (7df1a55)
  • prettier: Add quoteProps: 'consistent' config (#4) (4f49447)

3.1.0 (2019-03-21)

Features

  • base: Enforce jest/no-empty-title (cc76f49)

3.0.0 (2019-03-09)

Bug Fixes

  • base: Disable 'line-break-style' in favor of prettier (101af2d)
  • base: Lint jest plugin rules, add missing (ef87358)
  • base: Lint mocha plugin rules, add missing (f3f2096)
  • base: Switch to confusing-browser-globals (e2a129b)
  • peer: Tighten prettier range to ^1.16.4 (3d0bd89)
  • style: Allow non-camelCase when destructuring (ebb6a3c)

Features

  • base: Add explicit prettier config defaults (e4b5717)
  • best-practices: Enforce max-classes-per-file (9274049)
  • best-practices: Enforce no-self-assign for properties (0eb3505)
  • best-practices: Enforce no-useless-catch (487ffdf)
  • errors: Enforce no-async-promise-executor (5612fc4)
  • errors: Enforce no-misleading-character-class (50b936a)
  • errors: Enforce require-atomic-updates (206f0ac)
  • jest: Enforce jest/expect-expect (d80cc09)
  • jest: Enforce jest/no-jasmine-globals (40e9087)
  • jest: Enforce jest/no-test-return-statement (8f8af38)
  • jest: Enforce jest/no-truthy-falsy (69bcd05)
  • jest: Enforce jest/prefer-todo (d7d29fd)
  • meta: Sync latest upstream changes (e6e463e)
  • mocha: Enforce mocha/no-mocha-arrows (a58e1d8)
  • peer: Bump lower range of peerDependencies (a83ca95)
  • style: Enforce func-name-matching (dc07745)
  • style: Enforce prefer-object-spread (0b5347c)

BREAKING CHANGES

  • peer: The peer dependency on prettier has been tightened to encompass React Hooks-related features and bugfixes, as well as to explicitly disclaim support for all versions 2.x and above.
  • mocha: Passing an arrow function to a Mocha test case is now an error.
  • style: Prefer object spread instead of Object.assign(). This rule is fixable.
  • style: Function names must match the name of the variable or property to which they are assigned.
  • style: camelcase no longer errors when (predominantly) Python APIs insist on returning JSON with snake_case keys.
  • errors: Assignments that can lead to race conditions due to usage of await or yield are not allowed.
  • errors: Misleading character classes in regular expressions are not allowed.
  • errors: Passing an async function to the Promise constructor is not allowed.
  • peer: Several new rules require a higher minimum version of various peer plugins.
  • best-practices: Self-assigning properties is not allowed.
  • best-practices: Only one class per-file is allowed.
  • jest: Emtpy test cases are no longer allowed. This rule is fixable.
  • jest: The toBeTruthy() and toBeFalsy() assertions are no longer allowed. There are several assertions available with greater clarity.
  • jest: Returning values from test cases is not allowed. Tests with Promise return values should be converted to async/await.
  • jest: Jasmine globals are no longer allowed. This rule is fixable.
  • jest: Test cases without a call to expect() will now error. If you use a different assertion function, you will need to extend the assertionFunctionNames rule option.
  • best-practices: Empty catch statements are not allowed.

2.1.3 (2019-01-14)

Bug Fixes

  • prettier: Add lerna.json and .eslintrc.json to json-stringify overrides (ec46f69)
  • prettier: YAML always uses 2-space indent (967a1f5)

2.1.2 (2019-01-14)

Bug Fixes

  • base: Add disabled no-useless-catch config (26b1398)
  • prettier: Explicitly preserve npm default formatting for manifests and lockfiles (50c54dc)

2.1.1 (2018-11-08)

Bug Fixes

  • jest: Disable prefer-spy-on, it is buggy (c3b5c53)

2.1.0 (2018-11-08)

Features

  • base: Expand eslint-plugin-jest peer range (8e1f24c)
  • jest: Update rules, error all fixable rules (7bb2d8a)

2.0.0 (2018-11-06)

Features

  • Loosen prettier peer to >= 1.13.0 (24c5fcb)
  • Raise floor of eslint peer to >= 5.0.0 (5b8abfc)
  • Upgrade eslint-plugin-prettier to ^3.0.0 (d636689)

BREAKING CHANGES

  • eslint v4 is no longer supported

1.0.0 (2018-08-15)

Bug Fixes

  • base: Add import/no-relative-parent-imports rule (c94f162)
  • base: Update ecmaVersion to 2018, remove deprecated experimentalObjectRestSpread ecmaFeature (0a34930)
  • pkg: Correct homepage URL (1b5e7f0)

Features

  • Add eslint v5 support (a52862a)
  • Raise floor of peer dependency ranges (3d6bbfd)

1.0.0-rc.0 (2018-06-05)

Features

  • Sync upstream eslint plugins (5e42578)
  • prettier: Remove explicit parser from config (ce6a740)

1.0.0-beta.0 (2018-04-26)

Bug Fixes

  • base: Demote 'special' prettier rules to warnings (0f0dca0)
  • base: Demote max-len to a warning, super-long comments should not break builds (e09a582)
  • base: Demote prefer-destructuring to a warning, as it is not auto-fixable (307647f)

1.0.0-alpha.5 (2018-04-10)

Features

  • eslint-config-zillow-base: Enable line-comment-position warning (057102a)

1.0.0-alpha.4 (2018-04-07)

Bug Fixes

  • eslint-config-zillow-base: Avoid extraneous import warnings under mocks (442a517)

Features

  • Add Jest subpath config/plugin (b639c7e)
  • Add Mocha subpath config/plugin (9ddfa68)

1.0.0-alpha.3 (2018-04-06)

Bug Fixes

  • styles: Correct indent arg of max-len rule (6e14aaf)
  • variables: Allow function declarations to hoist (17a8e64)
  • Normalize author metadata (bdcab0c)
  • Sync eslint peer dependency to ^4.19.1 (c5d5220)

BREAKING CHANGES

  • This updates the eslint peer's lower bound one minor version higher, from 4.18.1 to 4.19.1.

1.0.0-alpha.2 (2018-04-05)

Features

  • Replace stylistic rules with prettier (d50a4d1)

1.0.0-alpha.1 (2018-04-04)

Bug Fixes

  • base: Add import/no-cycle (ce6a719)

1.0.0-alpha.0 (2018-03-28)

Features