feat: init env

This commit is contained in:
tackchen 2020-12-09 17:09:44 +08:00
parent 46e2c7932b
commit 9c12a5ff37
9 changed files with 19735 additions and 35 deletions

View File

@ -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"
]
}

View File

@ -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": [
{

3
.gitignore vendored
View File

@ -1,6 +1,5 @@
node_modules
.vscode
nodejs
src_import_version
package-lock.json
# package-lock.json
vuepress/.vuepress/secret.js

33
.vscode/settings.json vendored Normal file
View File

@ -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
}
}

19621
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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",

View File

@ -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
};

View File

@ -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;

32
tsconfig.json Normal file
View File

@ -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"
]
}