Skip to content

Commit

Permalink
更新eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
mayuxian committed Feb 7, 2021
1 parent 9701695 commit 50ce969
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 48 deletions.
3 changes: 0 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
.cache/
node_modules/
/build
/lib
/public
55 changes: 55 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
module.exports = {
env: {
"browser": true,
"es2021": true,
"jest/globals": true
},
globals: {
"window": true,
},
extends: [
"eslint:recommended",
// "plugin:vue/essential",
// "plugin:@typescript-eslint/recommended"
],
parserOptions: {
"ecmaVersion": 12,
// "parser": "@typescript-eslint/parser",
// "sourceType": "module"
},
plugins: [
// "vue",
// "@typescript-eslint"
],
rules: {
"semi": [
2,
"never"
],
"comma-dangle": [
"error",
"never"
],
"no-param-reassign": [
0
],
"func-names": [
0
],
"import/no-extraneous-dependencies": [
0
],
"import/no-unresolved": [
2,
{
"ignore": [
"dayjs"
]
}
],
"import/extensions": [
2,
"never"
]
}
}
44 changes: 0 additions & 44 deletions .eslintrc.json

This file was deleted.

37 changes: 37 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module.exports = {
globals: {
// work around: https://github.com/kulshekhar/ts-jest/issues/748#issuecomment-423528659
'ts-jest': {
diagnostics: {
ignoreCodes: [151001],
},
},
},
testEnvironment: 'jsdom',
transform: {
'^.+\\.vue$': 'vue-jest',
'^.+\\.(t|j)sx?$': [
'babel-jest', {
presets: [
[
'@babel/preset-env',
{
targets: {
node: true,
},
},
],
'@babel/preset-typescript',
],
plugins: [
'@vue/babel-plugin-jsx',
'@babel/plugin-proposal-class-properties',
],
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
// u can change this option to a more specific folder for test single component or util when dev
// for example, ['<rootDir>/packages/input']
roots: ['<rootDir>'],
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
"eslint-config-standard": "^14.1.1",
"eslint-friendly-formatter": "^4.0.1",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"jest": "^26.6.3",
"ncp": "^2.0.0",
"prettier": "^2.2.1",
Expand Down

0 comments on commit 50ce969

Please sign in to comment.