Skip to content

nekochan0122/config

Repository files navigation

@nekochan0122/config

pnpm i -D @nekochan0122/config

ESLint (Flat Config + TypeScript)

  1. Install ESLint
pnpm i -D eslint typescript-eslint @eslint/js @eslint/compat @types/eslint__js
  1. Install Base Plugins
pnpm i -D globals @stylistic/eslint-plugin eslint-plugin-import eslint-plugin-simple-import-sort eslint-plugin-unicorn
  1. Use it

Base:

import nekoConfig from '@nekochan0122/config/eslint'
import globals from 'globals'
import tseslint from 'typescript-eslint'

export default tseslint.config(
  ...nekoConfig.presets.base,
  {
    languageOptions: {
      globals: globals.browser, // choose the correct globals for ur project
    },
    rules: {
      '@stylistic/indent': ['error', 4], // you can override rules in here
    },
  }
)

React:

pnpm i -D eslint-plugin-react eslint-plugin-react-hooks@rc eslint-plugin-react-refresh eslint-plugin-jsx-a11y
import nekoConfig from '@nekochan0122/config/eslint'
import globals from 'globals'
import tseslint from 'typescript-eslint'

export default tseslint.config(
  ...nekoConfig.presets.react,
  {
    languageOptions: {
      globals: globals.browser,
    },
  }
)
  1. Update VSCode Settings (Optional)
{
  "editor.formatOnSave": false,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "always"
  },
}

Caution

Do not use this config with Prettier or other formatter.

VSCode

  1. Install Fonts

Editor

Terminal

  1. Download Profile

https://github.com/nekochan0122/config/blob/main/src/vscode

  1. Import Profile

File -> Preferences -> Profile -> Import