Skip to content

2.6.0 ESLint 4.3 & Jest

Compare
Choose a tag to compare
@andreidmt andreidmt released this 22 Jul 22:41
· 390 commits to master since this release

Updated to ESLint 4.3 and added support for Jest testing framework.

Added

  • Plugin eslint-plugin-jest with rules in /rules/jest.js and part of frontend
  • ESLint rule prefer-numeric-literals: Disllow parseInt() and Number.parseInt() in favor of binary, octal, and hexadecimal literals
    • Defined in errors.js
    • Current value: "prefer-numeric-literals": "error"
  • ESLint rule prefer-destructuring: Prefer destructuring from arrays and objects.
    • Defined in variables.js
    • Current value:
      "prefer-destructuring": [
          "error", {
              object: true,
              array : true,
          }, {
              enforceForRenamedProperties: true,
          },
      ],
    • Sample:
      const array = [ 1,2,3,4,5 ]
      const lorem = {
          bar: "ipsum",
          foo: "dolor",
      }
      
      // const someIndex = 2
      // const foo = array[ someIndex ]
      const [ ,,foo ] = array
      
      // const bar = lorem.bar
      let { bar } = lorem;
      
      ( { bar } = {
          bar: 2,
          foo: 3,
      } );
      
      ( { foo: bar } = lorem )