-
Notifications
You must be signed in to change notification settings - Fork 20
Conversation
The intention is to eventually negate ( |
The lint does not work when I copied over searchbar.vue and made some random changes. No errors were shown.
EDIT: "lint": "./node_modules/.bin/eslint . --ext .vue" |
], | ||
'max-len': ['error', { 'code': 110 }], | ||
'operator-linebreak': ['error', 'before'], | ||
'quote-props': 'off', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we consider adding 'semi': 'off'
, since it looks like we are not enforcing the semi-colon terminator style?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's enforce it.
package.json
Outdated
@@ -78,6 +82,7 @@ | |||
"builddocs": "webpack --progress --hide-modules && set NODE_ENV=production webpack --progress --hide-modules", | |||
"docs": "webpack-dev-server --inline --hot --quiet --host 0.0.0.0", | |||
"gpages": "gh-pages -d .", | |||
"lint": "./node_modules/.bin/eslint . --ext .vue; exit 0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in an earlier comment, need to remove exit 0
, otherwise it will always pass :P.
The linter seems to be working fine, I managed to fix most styling issues in searchbar.vue, but I am not sure whether we should consider disabling these three rules:
A sample code that generates these errors: <script>
const array = [1, 2, 3]
const dict = { 'a': 1, 'b': 2, 'c': 3 }
// causes array-callback-return
array.map((val) => {
doSomething(val)
})
// causes guard-for-in & no-restricted-syntax
for (const key in dict) {
doSomething(dict[key])
}
</script> |
Those should be fixed: // array.map((val) => {
// doSomething(val)
// })
array.map(val => doSomething(val));
// for (const key in dict) {
// doSomething(dict[key])
// }
Object.keys(dict).foreach((key) => {
doSomething(dict[key]);
}); |
Ok, you might want to mention that in README.md. |
@acjh There is an issue with eslint not being able to parse the
The zip file below contains the offending file ( |
The part of the source code that is causing the issue: <doc-code language="javascript">
new Vue {
components: {
searchbar
},
data() {
return {
searchData: [
{
'headings': {
'normal-include': 'Normal include',
'establishing-requirements': 'Establishing Requirements',
'include-segment': 'Include segment',
'dynamic-include': 'Dynamic include',
'boilerplate-include': 'Boilerplate include',
'nested-include': 'Nested include',
'html-include': 'HTML include',
'include-from-another-markbind-site': 'Include from another Markbind site',
'feature-list': 'Feature list',
},
'title': 'Hello World',
'src': 'index.md',
},
{
'headings': {
'popover-initiated-by-trigger-honor-trigger-attribute':
'popover initiated by trigger: honor trigger attribute',
'support-multiple-inclusions-of-a-modal': 'Support multiple inclusions of a modal',
'remove-extra-space-in-links': 'Remove extra space in links',
},
'title': 'Open Bugs',
'src': 'bugs/index.md',
},
{
'headings': {
'feature-list': 'Feature list',
},
'src': 'sub_site/index.md',
'title': '',
},
],
searchTemplate: '<span v-html="item.title | highlight value" /><br />'
+ '<span v-if="item.keywords" v-html="item.keywords | highlightAndExtract value<br />" />'
+ '<span v-if="item.heading" v-html="item.heading.text | highlight value" />',
};
}
}
</doc-code>
Errors:
|
What is the purpose of this pull request? (put "X" next to an item, remove the rest)
• [x] Other, please explain: Code quality
What is the rationale for this request?
Consistency.
What changes did you make? (Give an overview)
Provide some example code that this change will affect:
How do I pick one? 😭
should be
Is there anything you'd like reviewers to focus on?
-
Testing instructions:
$ npm run lint