Skip to content

Commit 35a75e6

Browse files
committed
fix
1 parent 863358e commit 35a75e6

File tree

4 files changed

+219
-0
lines changed

4 files changed

+219
-0
lines changed

packages/vue-pack/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# @devtree/vue-pack
2+
3+
<p align="center">
4+
<img src="https://img.shields.io/github/license/tetritz/devtree?style=for-the-badge" alt="License MIT">
5+
</p>
6+
7+
This is NOT for PRODUCTION.\
8+
Now it is in testing.
9+
---
10+
11+
This package includes the shareable ESLint configuration,
12+
Prettier configuration for Vue, <b>TypeScript</b> development.
13+
14+
## Installation
15+
- Using npm:
16+
```shell script
17+
npm i -D @devtree/vue-pack
18+
```
19+
20+
- or using yarn:
21+
```shell script
22+
yarn add -D @devtree/vue-pack
23+
```
24+
25+
## Usage
26+
27+
### Basic usage
28+
- `package.json`
29+
```json
30+
{
31+
"eslintConfig": {
32+
"extends": [
33+
"@devtree/vue-pack/eslint/base"
34+
]
35+
}
36+
}
37+
```
38+
39+
- Or, `.eslintrc.json`
40+
```json
41+
{
42+
"extends": "@devtree/vue-pack/base"
43+
}
44+
```
45+
46+
### Basic usage for Nuxt.js
47+
- `.eslintrc.json`
48+
```json
49+
{
50+
"extends": "@devtree/vue-pack/nuxt"
51+
}
52+
```
53+
54+
## Configuration Set
55+
56+
- @devtree/vue-pack/base : for normal Vue projects.
57+
- @devtree/vue-pack/nuxt : for Nuxt.js projects.
58+
59+
## License
60+
61+
@devtree/vue-pack is licensed under the [MIT License.](https://github.com/tetritz/devtree/blob/main/LICENSE)

packages/vue-pack/eslint/base.js

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
module.exports = {
2+
// For JavaScript
3+
root: true,
4+
env: {
5+
browser: true,
6+
es6: true,
7+
jest: true,
8+
node: true,
9+
},
10+
extends: [
11+
'plugin:vue/vue3-recommended',
12+
'eslint:recommended',
13+
'prettier',
14+
'plugin:prettier/recommended',
15+
'@vue/typescript',
16+
],
17+
parser: 'vue-eslint-parser',
18+
parserOptions: {
19+
parser: '@typescript-eslint/parser',
20+
ecmaFeatures: {
21+
jsx: true,
22+
},
23+
ecmaVersion: 2020,
24+
sourceType: 'module',
25+
},
26+
plugins: ['@typescript-eslint', 'prettier', 'vue'],
27+
rules: {
28+
'class-methods-use-this': 0,
29+
eqeqeq: 0,
30+
'func-names': 0,
31+
'global-require': 0,
32+
'import/no-dynamic-require': 0,
33+
'import/prefer-default-export': 0,
34+
'lines-between-class-members': [2, 'always', { exceptAfterSingleLine: true }],
35+
'no-await-in-loop': 0,
36+
'no-console': 0,
37+
'no-continue': 0,
38+
'no-loop-func': 0,
39+
'no-nested-ternary': 0,
40+
'no-param-reassign': 0,
41+
'no-plusplus': 0,
42+
'no-restricted-syntax': 0,
43+
'no-template-curly-in-string': 0, // for yup interpolation
44+
'no-undef': 0,
45+
'no-underscore-dangle': 0,
46+
'no-use-before-define': 0,
47+
48+
'@typescript-eslint/explicit-module-boundary-types': 0,
49+
'@typescript-eslint/no-explicit-any': 0,
50+
'@typescript-eslint/no-var-requires': 0,
51+
'@typescript-eslint/no-use-before-define': 0,
52+
'@typescript-eslint/no-unused-vars': [
53+
2,
54+
{
55+
argsIgnorePattern: '^_',
56+
},
57+
],
58+
},
59+
60+
settings: {
61+
'import/parsers': {
62+
'@typescript-eslint/parser': ['.ts', '.tsx', '.vue'],
63+
},
64+
'import/resolver': {
65+
node: {
66+
extensions: ['.js', 'jsx', '.json', '.ts', '.tsx', '.d.ts'],
67+
},
68+
typescript: {
69+
/* project: ['tsconfig.json', 'packages/ * /tsconfig.json'], */
70+
},
71+
},
72+
},
73+
74+
// For TypeScript
75+
overrides: [
76+
{
77+
files: ['**/*.ts', '**/*.tsx', '**/*.vue'],
78+
rules: {
79+
'import/no-cycle': 0,
80+
81+
'@typescript-eslint/explicit-module-boundary-types': [
82+
1,
83+
{
84+
allowArgumentsExplicitlyTypedAsAny: true,
85+
},
86+
],
87+
},
88+
},
89+
],
90+
};

packages/vue-pack/package.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "@devtree/vue-pack",
3+
"version": "0.0.1",
4+
"description": "Simple tools and ESLint, Prettier configuration for Vue development",
5+
"keywords": [
6+
"dev",
7+
"development",
8+
"devtree",
9+
"eslint",
10+
"prettier",
11+
"typescript",
12+
"vue"
13+
],
14+
"files": [
15+
"eslint",
16+
"prettier.js"
17+
],
18+
"scripts": {
19+
"git:push": "git add . && git commit -m 'fix' && git push",
20+
"publish:patch": "npm version patch && npm publish",
21+
"publish:alpha": "npm version prerelease --preid alpha && npm publish",
22+
"v:patch": "npm version patch",
23+
"v:alpha": "npm version prerelease --preid alpha"
24+
},
25+
"repository": {
26+
"type": "git",
27+
"url": "https://github.com/lightica/devtree.git",
28+
"directory": "packages/vue-pack"
29+
},
30+
"bugs": {
31+
"url": "https://github.com/lightica/devtree/issues"
32+
},
33+
"author": "Lucas Choi <eterv7@gmail.com>",
34+
"license": "MIT",
35+
"dependencies": {
36+
"@typescript-eslint/eslint-plugin": "^4.22.0",
37+
"@typescript-eslint/parser": "^4.22.0",
38+
"@vue/eslint-config-typescript": "^7.0.0",
39+
"eslint": "^7.25.0",
40+
"eslint-config-prettier": "^8.3.0",
41+
"eslint-plugin-prettier": "^3.4.0",
42+
"eslint-plugin-vue": "^7.9.0",
43+
"prettier": "^2.2.1",
44+
"typescript": "^4.2.4"
45+
},
46+
"eslintConfig": {
47+
"extends": [
48+
"./eslint/base"
49+
]
50+
},
51+
"prettier": "./prettier"
52+
}

packages/vue-pack/prettier.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
printWidth: 100,
3+
tabWidth: 2,
4+
useTabs: false,
5+
semi: false,
6+
singleQuote: true,
7+
quoteProps: 'as-needed',
8+
jsxSingleQuote: false,
9+
trailingComma: 'es5',
10+
bracketSpacing: true,
11+
jsxBracketSameLine: false,
12+
arrowParens: 'always',
13+
proseWrap: 'preserve',
14+
vueIndentScriptAndStyle: false,
15+
endOfLine: 'lf',
16+
};

0 commit comments

Comments
 (0)