Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
build: setup linter
Browse files Browse the repository at this point in the history
  • Loading branch information
billyyyyy3320 committed Dec 15, 2019
1 parent a4aa0d5 commit 6aabec6
Show file tree
Hide file tree
Showing 4 changed files with 1,252 additions and 46 deletions.
63 changes: 63 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
module.exports = {
root: true,

env: {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},

globals: {
COMMENT_SERVICE: true
},

extends: [
'plugin:vue/recommended',
'plugin:prettier/recommended',
'prettier/@typescript-eslint',
"prettier/vue",
],

parserOptions: {
parser: 'babel-eslint' // Support dynamic import
},

rules: {
'no-undef': ['error'],

'vue/match-component-file-name': [
'error',
{
extensions: ['js', 'vue'],
shouldMatchCase: false
}
],

'vue/prop-name-casing': 0,

'vue/require-default-prop': 0
},

overrides: [
{
files: ['*.ts'],
extends: [
'plugin:@typescript-eslint/recommended'
],
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser'
},
rules: {
'@typescript-eslint/ban-ts-ignore': 0,

'@typescript-eslint/explicit-function-return-type': 0,

'@typescript-eslint/no-explicit-any': 0,

'@typescript-eslint/no-use-before-define': ['error', { functions: false }]
}
},
]
}
5 changes: 5 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
singleQuote: true,
tabWidth: 2,
trailingComma: 'es5',
}
47 changes: 22 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.5.2",
"description": "Offical blog plugin for VuePress",
"scripts": {
"lint": "xo",
"lint": "eslint src --ext .ts,.vue",
"dev": "concurrently \"rimraf lib\" \"npm:dev:client\" \"npm:dev:node\" \"nodemon\"",
"build": "concurrently \"rimraf lib\" \"npm:build:client\" \"npm:build:node\" \"npm:build:components\"",
"dev:client": "tsc -p tsconfig.client.json --watch",
Expand All @@ -28,6 +28,17 @@
},
"author": "ULIVZ <chl814@foxmail.com>",
"license": "MIT",
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,ts,vue}": [
"eslint --fix",
"git add"
]
},
"dependencies": {
"@vssue/api-github-v3": "^1.1.2",
"@vssue/vuepress-plugin-vssue": "^1.2.0",
Expand All @@ -36,11 +47,21 @@
"vuepress-plugin-sitemap": "^2.3.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^2.11.0",
"@typescript-eslint/parser": "^2.11.0",
"babel-eslint": "^10.0.3",
"concurrently": "^4.1.0",
"conventional-changelog-cli": "^2.0.1",
"cpx": "^1.5.0",
"eslint": "^6.7.2",
"eslint-config-prettier": "^6.7.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-vue": "^6.0.1",
"husky": "^3.1.0",
"inquirer": "^6.3.1",
"lint-staged": "^9.5.0",
"nodemon": "^1.18.7",
"prettier": "^1.19.1",
"rimraf": "^3.0.0",
"ts-node": "^7.0.1",
"typescript": "3.1.4",
Expand All @@ -53,30 +74,6 @@
"src/client/components/"
]
},
"xo": {
"extends": [
"rem",
"plugin:prettier/recommended",
"xo-typescript"
],
"extensions": [
"ts"
],
"rules": {
"unicorn/filename-case": "off",
"new-cap": "off",
"typescript/no-inferrable-types": "off",
"import/no-unassigned-import": "off",
"typescript/explicit-function-return-type": "off",
"no-throw-literal": "off",
"typescript/no-var-requires": "off",
"no-implicit-globals": "off",
"import/no-unresolved": "off",
"import/no-extraneous-dependencies": "off",
"typescript/no-use-before-define": "off",
"typescript/no-type-alias": "off"
}
},
"publishConfig": {
"registry": "https://registry.npmjs.org/"
}
Expand Down
Loading

0 comments on commit 6aabec6

Please sign in to comment.