Skip to content

Commit 4b5ea82

Browse files
authored
ignore code climate reporter error
2 parents 364a078 + 7abcb5f commit 4b5ea82

14 files changed

+1501
-145
lines changed

.eslintrc.js

+19-28
Original file line numberDiff line numberDiff line change
@@ -7,48 +7,32 @@
77
module.exports = {
88
root: true,
99
env: {
10-
node: true
10+
node: true,
1111
},
1212
extends: [
1313
'plugin:vue/essential',
1414
'@vue/standard',
15-
'@vue/typescript/recommended'
15+
'@vue/typescript/recommended',
16+
'plugin:prettier/recommended',
1617
],
1718
parserOptions: {
18-
ecmaVersion: 2020
19+
ecmaVersion: 2020,
1920
},
2021
rules: {
21-
'comma-dangle': [
22-
'error',
23-
'always-multiline',
24-
],
25-
'eqeqeq': 'off',
26-
'space-before-function-paren': [
22+
eqeqeq: 'off',
23+
'no-unused-vars': 'off',
24+
'@typescript-eslint/no-unused-vars': [
2725
'error',
2826
{
29-
'anonymous': 'always',
30-
'named': 'never',
31-
'asyncArrow': 'always',
27+
args: 'after-used',
3228
},
3329
],
34-
'object-curly-spacing': [
35-
'error',
36-
'never',
37-
],
38-
'operator-linebreak': [
39-
'error',
40-
'before',
41-
],
42-
'semi': [
43-
'error',
44-
'always',
45-
],
46-
'yoda': [
30+
yoda: [
4731
'error',
4832
'always',
4933
{
50-
'exceptRange': true,
51-
'onlyEquality': true,
34+
exceptRange: true,
35+
onlyEquality: true,
5236
},
5337
],
5438
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
@@ -64,5 +48,12 @@ module.exports = {
6448
jest: true,
6549
},
6650
},
67-
]
51+
{
52+
files: ['*.js'],
53+
rules: {
54+
'no-unused-vars': 2,
55+
'@typescript-eslint/no-unused-vars': 'off',
56+
},
57+
},
58+
],
6859
};

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/dist
2+
/docs
23
/lib
34
/tests/e2e/reports
45

.huskyrc.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"hooks": {
3+
"pre-commit": "pretty-quick --staged"
4+
}
5+
}

.prettierrc.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"arrowParens": "avoid",
3+
"bracketSpacing": true,
4+
"endOfLine": "lf",
5+
"htmlWhitespaceSensitivity": "css",
6+
"printWidth": 80,
7+
"proseWrap": "never",
8+
"quoteProps": "as-needed",
9+
"semi": true,
10+
"singleQuote": true,
11+
"trailingComma": "all",
12+
"tabWidth": 2,
13+
"useTabs": false,
14+
"vueIndentScriptAndStyle": false
15+
}

.travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ script:
2626
- cat ./coverage/lcov.info | coveralls
2727
- npm run test:e2e
2828
after_script:
29-
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
29+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT || echo code climate error is ignored.
3030

3131
before_deploy:
3232
- export TRAVIS_TAG=${TRAVIS_TAG:-$(node -p "require('./package.json').version")-$(date +'%Y.%m.%d')-$(git log --format=%h -1)}
3333
- echo ${TRAVIS_TAG}
34-
- "if [[ ${TAGGED} != 1 ]]; then git tag ${TRAVIS_TAG} && export TAGGED=1; fi"
35-
- "if [[ ! -e dist ]]; then npm run build && export PACKAGE=$(npm pack --silent); fi"
34+
- 'if [[ ${TAGGED} != 1 ]]; then git tag ${TRAVIS_TAG} && export TAGGED=1; fi'
35+
- 'if [[ ! -e dist ]]; then npm run build && export PACKAGE=$(npm pack --silent); fi'
3636
deploy:
3737
- provider: releases
3838
skip_cleanup: true

README.md

+27-21
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,51 @@
11
# vue-tree
22

3-
[![Master Build](https://travis-ci.com/eidng8/vue-tree.svg?branch=master)](https://travis-ci.com/eidng8/vue-tree)
4-
[![Master Coverage](https://coveralls.io/repos/github/eidng8/vue-tree/badge.svg?branch=master)](https://coveralls.io/github/eidng8/vue-tree?branch=master)
5-
[![Known Vulnerabilities](https://snyk.io/test/github/eidng8/vue-tree/badge.svg?targetFile=package.json)](https://snyk.io/test/github/eidng8/vue-tree?targetFile=package.json)
6-
7-
A Vue.js tree view component with stable DOM tree. By stable, it means the
8-
DOM structure will not change once it is rendered.
3+
[![master build](https://img.shields.io/travis/com/eidng8/vue-tree?color=333&logo=travis)](https://travis-ci.com/eidng8/vue-tree) [![vulnerabilities](https://img.shields.io/snyk/vulnerabilities/github/eidng8/vue-tree?color=333&logo=snyk)](https://snyk.io/test/github/eidng8/vue-tree?targetFile=package.json) [![maintainability](https://img.shields.io/codeclimate/maintainability/eidng8/vue-tree?color=333&logo=code-climate)](https://codeclimate.com/github/eidng8/vue-tree/maintainability) [![master coverage](https://img.shields.io/coveralls/github/eidng8/vue-tree/master?color=333&logo=coveralls)](https://coveralls.io/github/eidng8/vue-tree?branch=master) [![dev build](https://img.shields.io/travis/com/eidng8/vue-tree/dev?color=333&label=dev%20build&logo=travis)](https://travis-ci.com/eidng8/vue-tree/tree/dev) [![dev coverage](https://img.shields.io/coveralls/github/eidng8/vue-tree/dev?color=333&label=dev%20coverage&logo=coveralls)](https://coveralls.io/github/eidng8/vue-tree?branch=dev)
94

5+
A Vue.js tree view component with stable DOM tree. By stable, it means the DOM structure will not change once it is rendered.
106

117
## Performance Consideration
128

13-
The DOM structure of this component doesn't change once rendered.
14-
Comparing to others using `v-if`, which generate sub-nodes while expanded.
15-
While working on long list of items, lags will be obvious.
16-
17-
* This component will have a lag when once it is being rendered. After it is
18-
rendered, sub-trees are controlled by CSS, no DOM structure happens.
19-
* `v-if` components will lag whenever sub-trees are expanded, every time they
20-
are expanded.
9+
The DOM structure of this component doesn't change once rendered. Comparing to others using `v-if`, which generate sub-nodes while expanded. While working on long list of items, lags will be obvious.
2110

11+
- This component will have a lag when once it is being rendered. After it is rendered, sub-trees are controlled by CSS, no DOM structure happens.
12+
- `v-if` components will lag whenever sub-trees are expanded, every time they are expanded.
2213

2314
## Theming
2415

25-
This component provides a dark theme out of box. To use it, just add the
26-
`g8-tree__dark` class to the element.
16+
The bundled style sheet can be imported from `'g8-vue-tree/dist/g8-vue-tree.css'`. This component provides a dark theme out of box. To use it, just add the `g8-tree__dark` class to the element.
2717

2818
```html
2919
<ul class="g8-tree-view g8-tree__dark">
3020
<g8-tree-view></g8-tree-view>
3121
</ul>
3222
```
3323

34-
If you want to change the color of the component, just defined two variables
35-
before importing the scss file.
24+
If you want to change the color of the component, just defined two variables before importing the scss file.
3625

3726
```scss
3827
/* index.scss */
3928

4029
/* define these two variables before importing the scss file */
41-
$g8-tree-bg: #ccc !default;
42-
$g8-tree-fg: #333 !default;
30+
$g8-tree-bg: #ccc;
31+
$g8-tree-fg: #333;
4332

44-
@import "~vue-tree/src/components/tree-view.scss";
33+
@import '~vue-tree/src/components/tree-view.scss';
4534
```
35+
36+
## Props
37+
38+
| Prop name | Description | Type | Values | Default |
39+
| --- | --- | --- | --- | --- |
40+
| item | The tree data to be rendered. | G8TreeItem | - | |
41+
| checker | Whether to add a checkbox before each item, allowing multiple nodes to<br>be checked. | boolean | - | false |
42+
43+
## Events
44+
45+
| Event name | Type | Description |
46+
| --- | --- | --- |
47+
| click | G8ClickEvent | A tree node has been clicked. |
48+
| dblclick | G8ClickEvent | A tree node has been double clicked. |
49+
| tag-clicked | G8TagClickEvent | A tree node tag has been clicked. |
50+
| tag-dbl-clicked | G8TagClickEvent | A tree node tag has been double clicked. |
51+
| state-changed | G8StateChangeEvent | Checkbox state of the node has changed. |

docgen.config.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* GPLv3 https://www.gnu.org/licenses/gpl-3.0.en.html
3+
*
4+
* Author: eidng8
5+
*/
6+
7+
module.exports = {
8+
componentsRoot: 'src/components',
9+
components: '**/*.vue',
10+
outDir: 'docs',
11+
};

0 commit comments

Comments
 (0)