パッケージの詳細

eslint-config-mixmax

mixmaxhq704MIT5.2.6

Mixmax's WIP style guide for JavaScript.

style, guide, lint, mixmax

readme

eslint-config-mixmax

This project defines a linter configuration that enforces healthy JS syntax. Later it should probably enforce our code styles (sorry for the private link, non-Mixmaxers) or those of a more established guide—see Roadmap).

Installing

npm install -D eslint-config-mixmax

Install this config's peer dependencies if you haven't already:

npm install -D "eslint@>=7.18.0"

Using browser config

If you'll be using the browser configs, make sure to install the following dependencies:

  • eslint-plugin-react
  • eslint-plugin-react-hooks
  • @babel/eslint-parser
npm install -D "eslint-plugin-react@^7.23.1" "@babel/eslint-parser@^10.0.2" "eslint-plugin-react-hooks@^4.2.0"

Using Flow config

If you'll be using the flow configs, make sure to install the optional eslint-plugin-flowtype and @babel/eslint-parser dependencies.

npm install -D "eslint-plugin-flowtype@^3.11.1" "@babel/eslint-parser@^10.0.2"

Usage

Create .eslintrc.json files like

{
  "extends": "<name of config below>"
}

in the appropriate directories: extend…

  • "mixmax/node", in directories containing Node.js code.
  • "mixmax/node/spec", in directories containing Node specs (assumed to be using Jasmine).
  • "mixmax/node/ava", in directories containing ava tests.
  • "mixmax/node/next", in projects using node 8 syntax (should also extend mixmax/node).
  • "mixmax/flow", in projects using flow for type checking (should also extend mixmax/node or mixmax/browser).
  • "mixmax/browser", in directories containing browser code. eslint-plugin-react is enabled in this configuration to allow for React-specific linting. Additionally, Backbone and $ are globalized so that their import statements are not required by the linter (though they should be - see TODOs in this configuration file).
  • "mixmax/browser/spec", in directories containing browser specs (assumed to be using Jasmine).

If you want you can extend the base configuration directly ("extends": "mixmax") but you shouldn't need to since the Node and browser configurations already extend that.

Publishing a new version

GH_TOKEN=xxx npx semantic-release --no-ci

更新履歴

5.2.6 (2025-02-10)

Bug Fixes

5.2.5 (2025-02-10)

Bug Fixes

5.2.4 (2025-02-10)

Bug Fixes

5.2.3 (2025-02-10)

Bug Fixes

  • allow later typescript-eslint versions (bc31695)

5.2.2 (2024-02-27)

Bug Fixes

5.2.2 (2024-02-27)

Bug Fixes

5.2.1 (2024-02-23)

Bug Fixes

5.2.0 (2024-02-23)

Features

  • upgrade to Typescript 5 (6bee7ea)

Bug Fixes

  • deps: update dependency node to v18 (#97) (e4d6571)

5.1.0 (2023-02-16)

Features

  • require awaiting returned promises (629cbdd)

5.0.1 (2021-11-08)

Bug Fixes

  • remove deprecated babel parser (07849c3)

5.0.0 (2021-09-28)

⚠ BREAKING CHANGES

  • requires a tsconfig-lint.json file at the project's root which includes all Typescript files being linted. May break the build because of new eslint errors. This can be worked around by disabling rules in .eslintrc.json.

Features

  • add type-aware rules for Typescript code (3ce0cbf)

4.18.0 (2021-09-10)

Features

  • add specific react settings (379fd3f)

Bug Fixes

  • allow some unused varables (90c099d)
  • use more correct naming (b491b73)

4.17.0 (2021-07-22)

Features

  • ignore order of imports for test files (3e8701c)

4.16.0 (2021-07-21)

Features

  • have our TS config extend prettier by default (84ac14f)

4.15.0 (2021-06-25)

Features

  • add consistent curly enforcement (060aaa2)

4.14.0 (2021-06-16)

Features

  • add typescript eslint configs (1905187)

Bug Fixes

4.13.0 (2021-05-21)

Features

  • add rules of hooks to linter (1caabf5)

4.12.1 (2021-05-05)

Bug Fixes

  • fix react fragment rule config (67cb4f1)

4.12.0 (2021-03-30)

Features

  • prevent the usage of the fragment shorthand (18041f8)

4.11.4 (2021-01-29)

Bug Fixes

4.11.3 (2021-01-28)

Bug Fixes

  • import order (4cc3bf1)
  • update rule to match mixmax packages (8d102a1)

4.11.2 (2020-12-22)

Bug Fixes

4.11.1 (2020-05-19)

Bug Fixes

  • correctly depend on import plugin (#56) (8762ed1)

4.11.0 (2020-05-19)

Features

4.10.0 (2020-04-09)

Features

  • bump node ecmaVersion to support 10.x features (83d3626)

4.9.0 (2020-02-18)

Features

4.8.0 (2020-01-31)

Features

  • support test files in test and spec folders (82a3953)

4.7.0 (2020-01-25)

Features

  • ignore flow-typed/npm in flow config (25e8d88)

4.6.0 (2020-01-23)

Features

  • object-shorthand avoidExplicitReturnArrows (77a73c2)

4.5.0 (2020-01-23)

Features

  • add no-use-before-define rule to flow-typed definitions (5302dc4)
  • assume all=true for flow/strict instead of requiring annotations (8066720)
  • permit $-prefixed type names (ea32d4c)

4.4.0 (2020-01-18)

Features

  • add strict flow config (12aabb6)
  • override babel config file sourceType (4af9a2d)

4.3.0 (2019-12-11)

Features

  • require newline at the end of files (ff12437)

4.2.0 (2019-12-09)

Features

  • add jest config file override (96c158f)

4.1.0 (2019-11-19)

Features

  • add jest environment for unlabeled support files (7a335e4)

4.0.0 (2019-11-19)

⚠ BREAKING CHANGES

  • Any repositories that use mixmax/ava will be unable to do so in this version.
  • Projects that use the mixmax/node config but don't use mixmax/prettier may see new eslint errors.

Features

  • add jest environment to jest-like files (535c848)

Bug Fixes

  • remove ava config (84deae3)
  • use relative imports instead of named imports (e6ca89b)

improvement

  • include prettier in default node config (1d9b3bc)

Release History

  • 3.4.0 Use treatUndefinedAsUnspecified with consistent-return.

  • 3.3.0 Add mixmax/prettier to compose with mixmax/node when adopting prettier.

  • 3.2.0 Add consistent-return rule.

  • 3.1.0 Add mixmax/node/disable-require-atomic

  • 2.1.0 Adds no-throw-literal rule

  • 2.0.0 Upgrade eslint to Breaking remove

  • 1.3.0 Add parseInt radix rule

  • 1.2.0 Deprecate browser globals, add browser/legacy for that purpose

  • 1.1.0 Add no-return-await rule

  • 0.12.0 Add new rules prefer-const, object-shorthand, space-before-function-paren.

  • 0.11.0 Add Jest config

  • 0.10.0 jsx-quotes prefer-single

  • 0.9.0 no-mixed-operators ||,&&

  • 0.8.1 Fix missing comma in browser/index.js

  • 0.8.0 Add jsx paren rule

  • 0.7.0 Enforce arrow-parens with error.

  • 0.6.0 Add ava config

  • 0.5.0 Globalize analytics in browser configs.

  • 0.4.2 Make babel-eslint an optional dependency.

  • 0.4.1 Make eslint-plugin-react an optional dependency.

  • 0.4.0 Add browser and browser/spec configs.