updated sorting system and added linting

This commit is contained in:
mx 2022-07-13 18:36:48 +02:00
parent 2d33c28f6b
commit 116eb3c867
2 changed files with 55 additions and 19 deletions

View File

@ -9,7 +9,7 @@ module.exports = (config) => {
for (let page of pages) { for (let page of pages) {
if (page.data.sort) { if (page.data.sort) {
if (sorted[page.data.sort]) { if (sorted[page.data.sort]) {
sorted.splice(page.data.sort) sorted.splice(page.data.sort, 0, page)
} else { } else {
sorted[page.data.sort] = page sorted[page.data.sort] = page
} }

36
.eslintrc.json Normal file
View File

@ -0,0 +1,36 @@
{
"env": {
"browser": true,
"commonjs": true,
"es2021": false,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": "latest"
},
"rules": {
"no-var": "error",
"semi": ["error", "never"],
"quotes": ["error", "single"],
"indent": ["error", 2],
"arrow-spacing": "error",
"array-bracket-spacing": ["error", "always"],
"array-bracket-newline": ["error", "consistent"],
"object-curly-spacing": ["error", "always"],
"object-curly-newline": ["error", { "consistent": true }],
"space-before-blocks": ["error", "always"]
},
"overrides": [
{
"files": ["./assets/**/*.js"],
"env": {
"commonjs": false,
"node": false
},
"parserOptions": {
"sourceType": "module"
}
}
]
}