add ESLint
This commit is contained in:
parent
1e4d0c0a09
commit
0ee1d8cc18
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2020": true
|
||||
},
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:ava/recommended"
|
||||
],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 11,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
"ava"
|
||||
],
|
||||
"rules": {
|
||||
"indent": [
|
||||
"error",
|
||||
2
|
||||
],
|
||||
"quotes": [
|
||||
"error",
|
||||
"single"
|
||||
],
|
||||
"semi": [
|
||||
"error",
|
||||
"never"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -28,5 +28,6 @@ More details can be found in the [WordPress Plugin Directory](https://wordpress.
|
|||
10. Tag the new version in `git` too.
|
||||
|
||||
### Other commands
|
||||
- Run ESLint: `npm run eslint`
|
||||
- Run tests: `npm test`
|
||||
- Delete build folder: `gulp clean`
|
||||
|
|
|
@ -32,7 +32,7 @@ function bundleFrontend() {
|
|||
},
|
||||
}))
|
||||
.pipe(dest(FOLDER_BUILD));
|
||||
}
|
||||
}
|
||||
|
||||
function copyBackend() {
|
||||
return src([
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -6,6 +6,7 @@
|
|||
"scripts": {
|
||||
"build-dev": "gulp dev",
|
||||
"build-prod": "ava && gulp prod",
|
||||
"eslint": "npx eslint source/**/*.js",
|
||||
"test": "ava"
|
||||
},
|
||||
"author": {
|
||||
|
@ -26,6 +27,8 @@
|
|||
"devDependencies": {
|
||||
"ava": "^3.15.0",
|
||||
"del": "^6.0.0",
|
||||
"eslint": "^7.23.0",
|
||||
"eslint-plugin-ava": "^12.0.0",
|
||||
"esm": "^3.2.25",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-replace": "^1.0.0",
|
||||
|
|
|
@ -23,7 +23,7 @@ function displayEvents(data, list) {
|
|||
dateText += ' ' + beginsOn.get24Time()
|
||||
dateText += ' - '
|
||||
if (!beginsOn.equalsDate(endsOn)) {
|
||||
dateText += endsOn.getShortDate() + ' '
|
||||
dateText += endsOn.getShortDate() + ' '
|
||||
}
|
||||
dateText += endsOn.get24Time()
|
||||
const textnode = document.createTextNode(dateText)
|
||||
|
|
|
@ -11,5 +11,5 @@ test('createAnchorElement() usual parameters', t => {
|
|||
const a = HtmlCreator.createAnchorElement({ text: 'a', url: 'b' })
|
||||
t.is(a.tagName, 'A')
|
||||
t.is(a.innerHTML, 'a')
|
||||
t.is(a.getAttribute('href'), 'b')
|
||||
t.is(a.getAttribute('href'), 'b')
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue