🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

eslint-config-tpconfig

Package Overview
Dependencies
Maintainers
4
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-tpconfig

Vue 项目自定义 eslint 规则

latest
Source
npmnpm
Version
0.3.3
Version published
Weekly downloads
3
-83.33%
Maintainers
4
Weekly downloads
 
Created
Source

eslint-config-tpconfig

此扩展包是在 eslint:recommendedplugin:vue/recommended@vue/standard 基础之上配置的一组规则。使用时需要将 'tpconfig' 放在 extends 的末尾。

使用

$ npm install eslint-config-tpconfig -D
// .eslintrc.js
module.exports = {
    root: true,
    env: {
        browser: true,
        node: true,
        es6: true,
    },
    extends: [
        'eslint:recommended',
        'plugin:vue/recommended',
        '@vue/standard',
+       'tpconfig',
    ],
    parser: 'vue-eslint-parser',
    parserOptions: {
        parser: 'babel-eslint',
        sourceType: 'module',
    },
    globals: {
        _: 'readonly',
        axios: 'readonly',
    },
};

在现有的 Vue 项目中使用,可能需要先升级 eslint 到 6.x。

创建新的项目,可以直接使用 vue-preset 无需额外安装依赖。

$ vue create --preset CDTRSFE/vue-preset <project-name>

升级

此规则单独维护,如果配置有修改会发新的 npm 包,npm update eslint-config-tpconfig -D 升级即可,或者卸载之后重新安装。

Keywords

eslint

FAQs

Package last updated on 09 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts