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.
|
10. Tag the new version in `git` too.
|
||||||
|
|
||||||
### Other commands
|
### Other commands
|
||||||
|
- Run ESLint: `npm run eslint`
|
||||||
- Run tests: `npm test`
|
- Run tests: `npm test`
|
||||||
- Delete build folder: `gulp clean`
|
- Delete build folder: `gulp clean`
|
||||||
|
|
|
@ -32,7 +32,7 @@ function bundleFrontend() {
|
||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
.pipe(dest(FOLDER_BUILD));
|
.pipe(dest(FOLDER_BUILD));
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyBackend() {
|
function copyBackend() {
|
||||||
return src([
|
return src([
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -6,6 +6,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build-dev": "gulp dev",
|
"build-dev": "gulp dev",
|
||||||
"build-prod": "ava && gulp prod",
|
"build-prod": "ava && gulp prod",
|
||||||
|
"eslint": "npx eslint source/**/*.js",
|
||||||
"test": "ava"
|
"test": "ava"
|
||||||
},
|
},
|
||||||
"author": {
|
"author": {
|
||||||
|
@ -26,6 +27,8 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"ava": "^3.15.0",
|
"ava": "^3.15.0",
|
||||||
"del": "^6.0.0",
|
"del": "^6.0.0",
|
||||||
|
"eslint": "^7.23.0",
|
||||||
|
"eslint-plugin-ava": "^12.0.0",
|
||||||
"esm": "^3.2.25",
|
"esm": "^3.2.25",
|
||||||
"gulp": "^4.0.2",
|
"gulp": "^4.0.2",
|
||||||
"gulp-replace": "^1.0.0",
|
"gulp-replace": "^1.0.0",
|
||||||
|
|
|
@ -23,7 +23,7 @@ function displayEvents(data, list) {
|
||||||
dateText += ' ' + beginsOn.get24Time()
|
dateText += ' ' + beginsOn.get24Time()
|
||||||
dateText += ' - '
|
dateText += ' - '
|
||||||
if (!beginsOn.equalsDate(endsOn)) {
|
if (!beginsOn.equalsDate(endsOn)) {
|
||||||
dateText += endsOn.getShortDate() + ' '
|
dateText += endsOn.getShortDate() + ' '
|
||||||
}
|
}
|
||||||
dateText += endsOn.get24Time()
|
dateText += endsOn.get24Time()
|
||||||
const textnode = document.createTextNode(dateText)
|
const textnode = document.createTextNode(dateText)
|
||||||
|
|
|
@ -11,5 +11,5 @@ test('createAnchorElement() usual parameters', t => {
|
||||||
const a = HtmlCreator.createAnchorElement({ text: 'a', url: 'b' })
|
const a = HtmlCreator.createAnchorElement({ text: 'a', url: 'b' })
|
||||||
t.is(a.tagName, 'A')
|
t.is(a.tagName, 'A')
|
||||||
t.is(a.innerHTML, 'a')
|
t.is(a.innerHTML, 'a')
|
||||||
t.is(a.getAttribute('href'), 'b')
|
t.is(a.getAttribute('href'), 'b')
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue