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

Package detail

@stacks/eslint-config

blockstack7.2kMIT2.0.0

A re-usable ESLint config for Stacks projects

readme

@stacks/eslint-config

A set of ESLint configuration and rules for use in Stacks projects.

Installation

yarn add --dev eslint @stacks/eslint-config
# or, with npm
npm install --save-dev eslint @stacks/eslint-config

Then, create or modify your .eslintrc.js file to extend this config:

module.exports = {
  extends: '@stacks/eslint-config',
  parser: '@typescript-eslint/parser',
  parserOptions: {
    tsconfigRootDir: __dirname,
    project: ['./tsconfig.json'],
    ecmaVersion: 2019,
    sourceType: 'module',
  },
};

Finally, modify your package.json file to use our prettier config, which is already installed as a dependency of this package.

{
  "prettier": "@stacks/prettier-config"
}

Overriding rules

This configuration includes a bunch of rules that have become standard in our JavaScript projects. However, if you feel the need to override a rule, you can always do so by simply adding rules to your .eslintrc.js file.

module.exports = {
  extends: ['@stacks/eslint-config'],
  rules: {
    '@typescript-eslint/no-use-before-define': [2],
  },
};

changelog

2.0.0 (2023-08-14)

⚠ BREAKING CHANGES

  • manually update to v2 for semantic release

Features

  • manually update to v2 for semantic release (44f329f)

1.0.0 (2023-08-10)

Bug Fixes

  • add eslint-prettier deps (a3ada9d)
  • eslint using default config (d80845d)
  • include prettier as dependency (b922ef0)
  • unused-imports: unused imports will now be highlighted as errors (448ed09)
  • use & lint with our prettier (916473b)

Features

  • deps: update all (b9c42b9)
  • enable non-null assertion rule by default (5d72592)
  • enforce array syntax, update packages (731fba8)
  • first set of ESLint config (b65c111)
  • rename to Stacks (a8557d5)
  • update packages (6dc7655)