Skip to content

Commit 9ce3014

Browse files
committed
fix
1 parent e173415 commit 9ce3014

File tree

3 files changed

+148
-0
lines changed

3 files changed

+148
-0
lines changed

packages/base-pack/eslint/base.js

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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+
require.resolve('eslint-config-airbnb-base'),
12+
'plugin:@typescript-eslint/recommended',
13+
'plugin:prettier/recommended',
14+
'prettier/@typescript-eslint',
15+
],
16+
parser: '@typescript-eslint/parser',
17+
parserOptions: {
18+
ecmaVersion: 2020,
19+
sourceType: 'module',
20+
},
21+
plugins: ['@typescript-eslint', 'prettier'],
22+
rules: {
23+
'class-methods-use-this': 0,
24+
eqeqeq: 0,
25+
'func-names': 0,
26+
'global-require': 0,
27+
'import/extensions': [
28+
2,
29+
'ignorePackages',
30+
{
31+
js: 'never',
32+
ts: 'never',
33+
},
34+
],
35+
'import/no-dynamic-require': 0,
36+
'import/no-extraneous-dependencies': [2, { devDependencies: true }],
37+
'import/prefer-default-export': 0,
38+
'lines-between-class-members': [2, 'always', { exceptAfterSingleLine: true }],
39+
'no-console': 0,
40+
'no-nested-ternary': 0,
41+
'no-param-reassign': 0,
42+
'no-plusplus': [2, { allowForLoopAfterthoughts: true }],
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'],
63+
},
64+
'import/resolver': {
65+
node: {
66+
extensions: ['.js', '.json', '.ts', '.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'],
78+
rules: {
79+
'@typescript-eslint/explicit-module-boundary-types': [
80+
1,
81+
{
82+
allowArgumentsExplicitlyTypedAsAny: true,
83+
},
84+
],
85+
},
86+
},
87+
],
88+
};

packages/base-pack/package.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "@devtree/base-pack",
3+
"version": "0.0.1",
4+
"description": "Simple tools and ESLint, Prettier configuration for TypeScript development",
5+
"files": [
6+
"eslint",
7+
"prettier.js"
8+
],
9+
"scripts": {
10+
"git:push": "git add . && git commit -m 'fix' && git push",
11+
"publish:patch": "npm version patch && npm publish",
12+
"publish:alpha": "npm version prerelease --preid alpha && npm publish",
13+
"v:patch": "npm version patch",
14+
"v:alpha": "npm version prerelease --preid alpha"
15+
},
16+
"repository": {
17+
"type": "git",
18+
"url": "https://github.com/tetritz/devtree.git",
19+
"directory": "packages/base-pack"
20+
},
21+
"bugs": {
22+
"url": "https://github.com/tetritz/devtree/issues"
23+
},
24+
"author": "Lucas Choi <eterv7@gmail.com>",
25+
"license": "MIT",
26+
"dependencies": {
27+
"@typescript-eslint/eslint-plugin": "^4.12.0",
28+
"@typescript-eslint/parser": "^4.12.0",
29+
"eslint": "^7.17.0",
30+
"eslint-config-airbnb-base": "^14.2.1",
31+
"eslint-config-prettier": "^7.1.0",
32+
"eslint-import-resolver-typescript": "^2.3.0",
33+
"eslint-plugin-import": "^2.22.1",
34+
"eslint-plugin-prettier": "^3.3.1",
35+
"prettier": "^2.2.1",
36+
"typescript": "^4.1.3"
37+
},
38+
"eslintConfig": {
39+
"extends": [
40+
"./eslint/base"
41+
]
42+
},
43+
"prettier": "./prettier"
44+
}

packages/base-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: true,
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)