npm.io
1.9.1 • Published 1 year ago

@okatechnology/eslint-config

Licence
MIT
Version
1.9.1
Deps
17
Size
11 kB
Vulns
0
Weekly
0
Stars
1

ESLint / Prettier / TypeScript Config

Install

npm install --save-dev @okatechnology/eslint-config

Usage

Config ESLint

create eslint.config.js at your project root.

Project Type Exported Config Name Config File Path
React eslintConfigReact eslintConfig/eslint.config.react.js
React Native eslintConfigReactNative eslintConfig/eslint.config.reactNative.js
Expo eslintConfigReactNativeExpo eslintConfig/eslint.config.reactNativeExpo.js
Next.js eslintConfigReactNext eslintConfig/eslint.config.reactNext.js
Node.js eslintConfigNode eslintConfig/eslint.config.node.js

If you want to config eslint for React project, write the following.

import { eslintConfigReact } from '@okatechnology/eslint-config/eslintConfig/eslint.config.react.js';

export default [
  ...eslintConfigReact,
  /* your config */
];
Config Prettier

create .prettierrc.js at your project root and write the following.

module.exports = {
  ...require('@okatechnology/eslint-config/prettierrc/prettierrc'),
}
Config TypeScript

create tsconfig.json at your project root.

Project Type Config File Path
React / Next.js tsconfig/tsconfig.react.json
React Native / Expo tsconfig/tsconfig.react-native.json
Node.js tsconfig/tsconfig.node.json

If you want to config tsconfig for React project, write the following.

{
  "extends": "@okatechnology/eslint-config/tsconfig/tsconfig.react.json",
  /* your config */
}