fix style issues

This commit is contained in:
Arthur Lu 2025-01-24 22:28:16 +00:00
parent 28a7630c9f
commit a9a5649afb
7 changed files with 5469 additions and 3 deletions

42
.eslintrc.json Normal file
View File

@ -0,0 +1,42 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": "standard",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"no-tabs": [
"error",
{
"allowIndentationTabs": true
}
],
"indent": [
"error",
"tab"
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
],
"brace-style": [
"error",
"stroustrup",
{
"allowSingleLine": false
}
]
}
}

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node_modules/*

6
.stylelintrc.json Normal file
View File

@ -0,0 +1,6 @@
{
"extends": [
"stylelint-config-standard"
],
"rules": {}
}

View File

@ -1,8 +1,7 @@
#gallery-container {
display: grid;
grid-template-columns: auto auto;
column-gap: 16px;
row-gap: 16px;
gap: 16px 16px;
margin-top: 1em;
margin-bottom: 1em;
}

5403
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

15
package.json Normal file
View File

@ -0,0 +1,15 @@
{
"scripts": {
"lint": "html-validator --continue; stylelint --formatter verbose --fix css/*.css; DEBUG=eslint:cli-engine eslint --fix scripts/"
},
"devDependencies": {
"eslint": "^8.43.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^16.0.1",
"eslint-plugin-promise": "^6.1.1",
"stylelint": "^15.9.0",
"stylelint-config-standard": "^33.0.0",
"w3c-html-validator": "^1.4.0"
}
}

View File

@ -42,7 +42,7 @@ class ModalImage extends HTMLElement {
}
connectedCallback () {
const thumbnail = this.getAttribute("thumb")
const thumbnail = this.getAttribute("thumb");
const src = this.getAttribute("src");
const alt = this.getAttribute("alt");
this.#src = src;