eslint-config-yyl-ts

0.1.0 • Public • Published

eslint-config-yyl-ts

为 yyl-ts 项目提供 eslint 文件

install

npm i eslint-config-yyl-ts --save-dev

依赖包

npm i typescript --save
npm i prettier eslint --save-dev

usage

修改 package.json 文件

{
  "eslintConfig": {
    "extends": ["yyl-ts"]
  },
  "eslintIgnore": [
    "node_modules",
    "/dist",
    "/test",
    "**/js/lib"
  ],
  "prettier": {
    "tabWidth": 2,
    "semi": false,
    "singleQuote": true,
    "jsxSingleQuote": true,
    "parser": "typescript",
    "quoteProps": "consistent",
    "trailingComma": "none",
    "printWidth": 100
  },
  "scripts": {
    "eslint": "eslint --ext=jsx,ts,tsx ./",
    "prettier": "prettier --write ./**/*.{ts,tsx,js}"
  }
}

为了和 prettier 不打架,请按照 package.jsonprettier 属性进行配置

自定义 prettier

可以通过定义 prettier/prettier rules 来修改

{
  "eslintConfig": {
    "rules": {
      "prettier/prettier": ["error", {
        "semi": true
      }]
    }
  },
  "prettier": {
    "semi": true
  }
}

定义 .prettierignore

**/js/lib/**
dist/**
node_modules/**
**/*.json
**/*.scss
**/*.yml
**/*.md

Readme

Keywords

none

Package Sidebar

Install

npm i eslint-config-yyl-ts

Weekly Downloads

1

Version

0.1.0

License

ISC

Unpacked Size

3.96 kB

Total Files

6

Last publish

Collaborators

  • jackness