ts-standard-eslint-flat-config

1.0.3 • Public • Published

ts-standard-eslint-flat-config

This library provides an eslint flat config file based on the ts-standard library.

Why?

ts-standard doesn't integrate with idea products, but eslint does. This config file allows using ts-standard rules and configuration in any idea that works with eslint.

usage

In your eslint.config.js import this library and spread the config into your config

import tsStandardEslintFlatConfig from 'ts-standard-eslint-flat-config'

export default [
  ...tsStandardEslintFlatConfig,
  //your config goes here
]

Or if you need to modify the configs or customize the configs you can import each of them individually

import {standardJs, standardTs, extraConfig} from 'ts-standard-eslint-flat-config'

delete standardts.rules['@typescript-eslint/strict-boolean-expressions']

export default [
  standardJs,
  standardTs,
  extraConfig
]

Use with React

For eslint to properly handle jsx files, the eslint-plugin-react dependency is required

For example

import {standardJs, standardTs, extraConfig} from 'ts-standard-eslint-flat-config'
import react from 'eslint-plugin-react'
import globals from 'globals'

const reactConfig = react.configs.flat.recommended

delete reactConfig.rules['react/prop-types']

export default [
  standardJs,
  react.configs.flat['jsx-runtime'],
  react.configs.flat.recommended,
  standardTs,
  extraConfig,
  {
    languageOptions: {
      globals: {
        ...globals.browser,
        ...globals.jest
      }
    }
  }
]

Package Sidebar

Install

npm i ts-standard-eslint-flat-config

Weekly Downloads

7

Version

1.0.3

License

MIT

Unpacked Size

4.42 kB

Total Files

3

Last publish

Collaborators

  • narcoleptic_snowman