feat: init env
This commit is contained in:
parent
46e2c7932b
commit
9c12a5ff37
22
.babelrc
22
.babelrc
|
@ -1,13 +1,15 @@
|
|||
{
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"targets": {
|
||||
"chrome": "58",
|
||||
"ie": "11"
|
||||
}
|
||||
}
|
||||
]
|
||||
"presets": [[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"useBuiltIns": "entry",
|
||||
"targets": {
|
||||
"esmodules": true
|
||||
}
|
||||
}
|
||||
]],
|
||||
"plugins": [
|
||||
"@babel/plugin-syntax-dynamic-import",
|
||||
"@babel/plugin-proposal-object-rest-spread"
|
||||
]
|
||||
}
|
35
.eslintrc.js
35
.eslintrc.js
|
@ -1,13 +1,12 @@
|
|||
module.exports = {
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es6": true,
|
||||
"node": true,
|
||||
"commonjs": true
|
||||
},
|
||||
"parser": '@typescript-eslint/parser',
|
||||
"plugins": [
|
||||
'@typescript-eslint',
|
||||
'vue/essential'
|
||||
],
|
||||
"extends": [
|
||||
// "standard",
|
||||
"plugin:vue/essential"
|
||||
// "plugin:vue/essential"
|
||||
],
|
||||
"parserOptions": {
|
||||
"parser": "babel-eslint",
|
||||
|
@ -27,8 +26,18 @@ module.exports = {
|
|||
"globals": {
|
||||
"window": true,
|
||||
"define": true,
|
||||
"console": true,
|
||||
"require": true,
|
||||
"module": true,
|
||||
},
|
||||
"rules": {
|
||||
// 'no-var': "error",
|
||||
// 优先使用 interface 而不是 type
|
||||
'@typescript-eslint/consistent-type-definitions': [
|
||||
"error",
|
||||
"interface"
|
||||
],
|
||||
"@typescript-eslint/no-unused-vars": "error", // 使用 ts 未使用变量的规则 比如枚举类型在es中会报错
|
||||
"no-extend-native": 0,
|
||||
"no-new": 0,
|
||||
"no-useless-escape": 0,
|
||||
|
@ -37,10 +46,6 @@ module.exports = {
|
|||
"indent": ["error", 4, {
|
||||
"SwitchCase": 1
|
||||
}],
|
||||
"vue/script-indent": ["warn", 4, {
|
||||
"baseIndent": 1,
|
||||
"switchCase": 1
|
||||
}],
|
||||
"space-infix-ops": ["error", {"int32Hint": false}],
|
||||
"space-before-function-paren": ["error", {
|
||||
"anonymous": "always",
|
||||
|
@ -66,8 +71,12 @@ module.exports = {
|
|||
"comma-spacing": "error",
|
||||
"key-spacing": "error",
|
||||
"no-undef": "error",
|
||||
"vue/html-indent": ["error", 4],
|
||||
"vue/html-quotes": ["error", "single", { "avoidEscape": true }],
|
||||
// "vue/script-indent": ["warn", 4, {
|
||||
// "baseIndent": 1,
|
||||
// "switchCase": 1
|
||||
// }],
|
||||
// "vue/html-indent": ["error", 4],
|
||||
// "vue/html-quotes": ["error", "single", { "avoidEscape": true }],
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
node_modules
|
||||
.vscode
|
||||
nodejs
|
||||
src_import_version
|
||||
package-lock.json
|
||||
# package-lock.json
|
||||
vuepress/.vuepress/secret.js
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"editor.formatOnSave": false, // 每次保存的时候将代码按eslint格式进行修复
|
||||
"eslint.validate": [
|
||||
//开启对.vue文件中错误的检查
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"html",
|
||||
"vue",
|
||||
{
|
||||
"language": "typescript",
|
||||
"autoFix": true
|
||||
},
|
||||
{
|
||||
"language": "html",
|
||||
"autoFix": true
|
||||
},
|
||||
{
|
||||
"language": "vue",
|
||||
"autoFix": true
|
||||
}
|
||||
],
|
||||
"search.exclude": {
|
||||
"**/node_modules": true,
|
||||
"**/cdn": true,
|
||||
"**/npm": true
|
||||
},
|
||||
"eslint.autoFixOnSave": true,
|
||||
"typescript.validate.enable": true,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": true
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -46,6 +46,8 @@
|
|||
"@babel/preset-env": "^7.5.5",
|
||||
"@commitlint/cli": "^8.2.0",
|
||||
"@commitlint/config-conventional": "^8.2.0",
|
||||
"@typescript-eslint/eslint-plugin": "^2.14.0",
|
||||
"@typescript-eslint/parser": "^2.14.0",
|
||||
"@vuepress/plugin-back-to-top": "^1.0.0-rc.1",
|
||||
"@vuepress/plugin-medium-zoom": "^1.0.0-rc.1",
|
||||
"babel-eslint": "^10.0.3",
|
||||
|
@ -64,6 +66,8 @@
|
|||
"husky": "^3.1.0",
|
||||
"less": "^3.9.0",
|
||||
"less-loader": "^5.0.0",
|
||||
"ts-loader": "^6.2.1",
|
||||
"typescript": "^3.7.4",
|
||||
"vue": "^2.5.2",
|
||||
"vue-highlight.js": "^2.2.0",
|
||||
"vuepress": "^1.0.2",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
var spell = require('./spell-dict-jian.json');
|
||||
var stroke = require('./stroke-count-jian.json');
|
||||
let spell = require('./spell-dict-jian.json');
|
||||
let stroke = require('./stroke-count-jian.json');
|
||||
module.exports = {
|
||||
spell, stroke
|
||||
};
|
|
@ -1,10 +1,10 @@
|
|||
var cnchar = require('../../main');
|
||||
var order = require('../order');
|
||||
var trad = require('../trad');
|
||||
var poly = require('../poly');
|
||||
var draw = require('../draw');
|
||||
var idiom = require('../idiom');
|
||||
var xhy = require('../xhy');
|
||||
var radical = require('../radical');
|
||||
let cnchar = require('../../main');
|
||||
let order = require('../order');
|
||||
let trad = require('../trad');
|
||||
let poly = require('../poly');
|
||||
let draw = require('../draw');
|
||||
let idiom = require('../idiom');
|
||||
let xhy = require('../xhy');
|
||||
let radical = require('../radical');
|
||||
cnchar.use(order, trad, poly, draw, idiom, xhy, radical);
|
||||
module.exports = cnchar;
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"outDir": "dist",
|
||||
"sourceMap": false,
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"allowJs": false,
|
||||
"noUnusedLocals": true,
|
||||
"strictNullChecks": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"experimentalDecorators": true,
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
"removeComments": false,
|
||||
"jsx": "preserve",
|
||||
"lib": ["esnext", "dom"],
|
||||
// "types": ["jest", "puppeteer", "node"],
|
||||
"rootDir": ".",
|
||||
// "paths": {
|
||||
// "@vue/*": ["packages/*/src"]
|
||||
// }
|
||||
},
|
||||
"include": [
|
||||
"./src/main/*"
|
||||
],
|
||||
"exclude": [
|
||||
"./node_modules"
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue