eslint-config-mdh-typescript-backend

1.1.1 • Public • Published

eslint-config-mdh-typescript-backend

Eslint config for TypeScript backend code (e.g. Node.js application, Lambda function, etc).

Usage

After installation, make sure to remove all the eslint and prettier related dependencies.

Add eslint-config-mdh-typescript-backend as part of extends in .eslintrc.js after installing the module.

module.exports = {
  root: true,
  env: {
    node: true,
  },
  extends: ['eslint-config-mdh-typescript-backend'],
  parserOptions: {
    project: './tsconfig-lint.json',
    ecmaVersion: 12,
    sourceType: 'module',
  },
  overrides: [{ files: ['**/*.ts'] }],
  rules: {},
};

You man want to have a separate tsconfig for the linting to include test files for linting. Create tsconfig-lint.json with custom file inclusion and exclusion rules. Below is an example.

{
  "extends": "./tsconfig",
  "include": ["./src/**/*", "./src/**/tests/*.spec.*", "./integration/**/*"],
  "exclude": [".eslintrc.js"]
}

To use prettier, add "prettier": "eslint-config-mdh-typescript-backend/prettier" to package.json.

If you are not sure how to use it, take a look at this repo as an example.

For TypeScript React eslint config, check out eslint-config-mdh-typescript-react🐱

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.1.10latest
1.0.0-add-semantic-release.10add-semantic-release

Version History

VersionDownloads (Last 7 Days)Published
1.1.10
1.1.00
1.0.00
1.0.0-add-semantic-release.10

Package Sidebar

Install

npm i eslint-config-mdh-typescript-backend

Weekly Downloads

0

Version

1.1.1

License

MIT

Unpacked Size

4.26 kB

Total Files

7

Last publish

Collaborators

  • mdhnpm