Skip to content

Commit bb27dd0

Browse files
author
wangxianqiao
committed
init
0 parents  commit bb27dd0

39 files changed

+8239
-0
lines changed

.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
packages/*/dist
2+
packages/*/bin
3+
packages/*/coverage
4+
packages/*/extension

.eslintrc.js

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
extends: [
4+
'plugin:import/errors',
5+
'plugin:import/warnings',
6+
'plugin:import/typescript',
7+
'plugin:@typescript-eslint/recommended',
8+
'plugin:prettier/recommended',
9+
],
10+
parserOptions: {
11+
ecmaVersion: 2018,
12+
sourceType: 'module',
13+
},
14+
settings: {
15+
'import/resolver': {
16+
typescript: {
17+
project: 'packages/*/tsconfig.json',
18+
},
19+
},
20+
},
21+
rules: {
22+
'no-console': 1,
23+
'import/no-named-as-default': 0,
24+
// https://github.com/benmosher/eslint-plugin-import/blob/HEAD/docs/rules/order.md
25+
'import/order': ['error', { 'newlines-between': 'always' }],
26+
'import/newline-after-import': 'error',
27+
'@typescript-eslint/no-non-null-assertion': 'off',
28+
'@typescript-eslint/no-var-requires': 'off',
29+
'@typescript-eslint/explicit-member-accessibility': 'off',
30+
'@typescript-eslint/explicit-function-return-type': 'off',
31+
'@typescript-eslint/explicit-module-boundary-types': 'off',
32+
'@typescript-eslint/no-explicit-any': 'off',
33+
'@typescript-eslint/no-unused-vars': [
34+
process.env.NODE_ENV === 'production' ? 2 : 1,
35+
{
36+
vars: 'all',
37+
args: 'after-used',
38+
ignoreRestSiblings: true,
39+
caughtErrors: 'none',
40+
varsIgnorePattern: '^_',
41+
argsIgnorePattern: '^_',
42+
},
43+
],
44+
},
45+
};

.github/workflows/lint.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: 14.x
18+
19+
- run: yarn
20+
- run: yarn run lint
21+
- run: yarn run test

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.env
2+
target
3+
4+
node_modules
5+
logs
6+
*.log
7+
npm-debug.log*
8+
.DS_Store

.prettierrc.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
semi: true,
3+
trailingComma: 'all',
4+
singleQuote: true,
5+
printWidth: 120,
6+
}

.vscode/gem.code-snippets

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
// Place your duoyun-fe workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
3+
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
4+
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
5+
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
6+
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
7+
// Placeholders with the same ids are connected.
8+
// Example:
9+
"Print to console": {
10+
"scope": "typescript",
11+
"prefix": "@custom",
12+
"body": [
13+
"import { GemElement, html, adoptedStyle, customElement, createCSSSheet, css } from '@mantou/gem';",
14+
"",
15+
"const style = createCSSSheet(css``);",
16+
"",
17+
"/**",
18+
" * @customElement ${1}-${2}",
19+
" */",
20+
"@customElement('${1:$WORKSPACE_NAME}-${2:$TM_FILENAME_BASE}')",
21+
"@adoptedStyle(style)",
22+
"export class ${3:${1/((^|-)(.))/${3:/upcase}/g}}${4:${2/((^|-)(.))/${3:/upcase}/g}}Element extends GemElement {",
23+
" render = () => {",
24+
" return html`${1}-${2}`;",
25+
" };",
26+
"}",
27+
""
28+
],
29+
"description": "use gem custom element"
30+
}
31+
}

.vscode/settings.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"typescript.validate.enable": true,
3+
"javascript.validate.enable": true,
4+
"css.validate": false,
5+
"less.validate": false,
6+
"scss.validate": false,
7+
"typescript.preferences.importModuleSpecifier": "non-relative",
8+
"typescript.tsdk": "node_modules/typescript/lib",
9+
"eslint.validate": ["typescript", "typescriptreact"],
10+
"editor.formatOnSave": true,
11+
"editor.defaultFormatter": "esbenp.prettier-vscode",
12+
"[xml]": {
13+
"editor.defaultFormatter": null
14+
},
15+
"editor.codeActionsOnSave": {
16+
"source.fixAll": true
17+
}
18+
}

0 commit comments

Comments
 (0)