@mkaradeniz/eslint-config-typescript

Personal ESLint TypeScript Configuration.

Usage no npm install needed!

<script type="module">
  import mkaradenizEslintConfigTypescript from 'https://cdn.skypack.dev/@mkaradeniz/eslint-config-typescript';
</script>

README

@mkaradeniz/eslint-config-typescript

Personal ESLint TypeScript Configuration.

Installation

yarn add -D @mkaradeniz/eslint-config-typescript
npx install-peerdeps --dev @mkaradeniz/eslint-config-typescript

Add following script to the package.json:

"lint": "eslint --ext .ts \"./src/\" --fix",

Create a .eslintrc.js with the following content:

const path = require('path')

module.exports = {
  extends: [require.resolve('@mkaradeniz/eslint-config-typescript')],
  parserOptions: {
    project: path.resolve(__dirname, './tsconfig.json'),
  },
}

GraphQL

To use the graphql plugin:

yarn add -D eslint-plugin-graphql
yarn add -D graphql # if not installed yet

Add the plugin to the .eslintrc.js plugins:

plugins: ['graphql']

Add the following to the .eslintrc.js rules:

rules: {
        'graphql/template-strings': [
            'error',
            {
                env: 'apollo',
                schemaJsonFilepath: path.resolve(__dirname, './schema.json'),
                tagName: 'gql',
            },
        ],
  },