5.3.1 • Published 4 years ago

@euberdeveloper/eslint-config-typescript v5.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@euberdeveloper/eslint-config-typescript

My personal eslint configuration when used with Typescript.

Brief description

An eslint configuration, that uses the standard @typescript-eslint/eslint-plugin for the Typescript rules and eslint-plugin-mocha for the mocha rules.

How to use it

Install the dependencies:

# eslint with the typescript configuration
npm i -D eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser

# eslint mocha plugin
npm i -D eslint-plugin-mocha

# this eslint configuration
npm i -D @euberdeveloper/eslint-config-typescript

Add this .eslintrc.js file to your root:

const path = require('path');

module.exports = {
    parserOptions: {
        project: path.join(__dirname, 'tsconfig.json') // The path to your tsconfig.json
    },
    extends: [ '@euberdeveloper/typescript' ]
};

If you want to use it with prettier

Run this:

# prettier with its eslint connector
npm i -D prettier eslint-plugin-prettier eslint-config-prettier

Add this .prettierrc.js file to your root:

module.exports = {
    tabWidth: 4,
    singleQuote: true,
    quoteProps: 'consistent',
    trailingComma: 'none',
    arrowParens: 'avoid',
    printWidth: 120,
    endOfLine: 'auto'
};

Change the .eslintrc.js file to this:

const path = require('path');

module.exports = {
    parserOptions: {
        project: path.join(__dirname, 'tsconfig.json') // The path to your tsconfig.json
    },
    plugins: ['prettier'],
    extends: [
        '@euberdeveloper/typescript',
        'plugin:prettier/recommended'
    ]
};

Now you can just use eslint to lint your code

You can also add some scripts to the package.json in order to have it always ready.

5.3.1

4 years ago

5.2.2

4 years ago

5.3.0

4 years ago

5.2.1

4 years ago

5.2.0

4 years ago

5.1.0

4 years ago

5.0.0

4 years ago

4.8.1

4 years ago

4.7.0

5 years ago

4.6.0

5 years ago

4.5.0

5 years ago

4.4.0

5 years ago

4.3.0

5 years ago

4.2.0

5 years ago

4.1.3

5 years ago

4.1.0

5 years ago

4.1.2

5 years ago

4.1.1

5 years ago

4.0.0

5 years ago

3.0.0

5 years ago

2.0.0

5 years ago

1.0.0

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago