4.3.1 • Published 2 years ago

@teachers/eslint-config-tpt-typescript v4.3.1

Weekly downloads
327
License
MIT
Repository
-
Last release
2 years ago

eslint-config-tpt-typescript

Recommended TpT eslint config with typescript. Owned and maintained by Web Platform.

This package currently includes rules that are applicable both for React-based projects and Node backends.

Usage

1) Add to your project's dependencies:

yarn add --dev @teachers/eslint-config-tpt-typescript

2) Reference in your .eslintrc.js file:

Your project should have a .eslintrc.js file to configure ESLint. (If you're using a .json config file, please convert it to .js), that looks like:

// Patch ESLint to allow managing plugins via shared configuration files
require('@teachers/eslint-config-tpt-typescript/eslint-patch');

module.exports = {
  // Extend from TPT shared config
  extends: '@teachers/tpt-typescript',

  // Don't combine with ESLint configs in parent folders
  root: true,

  // Setup for Typescript
  settings: {
    'import/resolver': {
      typescript: {},
    },
  }
}

3) Configure Prettier

To get Prettier to work with this config, use the following .pretterrc.json:

{
  "singleQuote": true,
  "arrowParens": "always"
}

Release and versioning

This package follows semantic versioning enforced by the semantic-pr app and uses standard-version to generate changelogs. Note that most rule changes are going to require BREAKING CHANGE (i.e. they might cause existing apps to no longer pass linting). To make a change

  • Open a pr with a semantic title/body and get it approved and merged. Do not modify the version in package.json or the changelog.
  • In master run yarn release. Note you need permission to push to master to get it to run. Contact web-platform if you don't have permissions. This script will generate a Changelog, bump the version, commit the change, and run yarn publish.