Skip to content

Commit

Permalink
Merge branch 'hotfix/prettier-eslint'
Browse files Browse the repository at this point in the history
* hotfix/prettier-eslint:
  REFACTOR. Improve code to maintain compliance with `eslint` rules
  BUGFIX. Get `eslint` errors when run the npm script `lint`
  STYLE. Format code with the npm script `lint`
  BUGFIX. Update `eslint` configuration
  STYLE. Format code with the npm script `lint`
  BUGFIX. Update `prettier` configuration
  STYLE. Sort json and remove comments from VSC settings
  • Loading branch information
beatrizsmerino committed Jul 20, 2023
2 parents 619681d + e56742b commit 0248bde
Show file tree
Hide file tree
Showing 32 changed files with 5,226 additions and 2,025 deletions.
784 changes: 431 additions & 353 deletions .eslintrc.js

Large diffs are not rendered by default.

43 changes: 28 additions & 15 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
{
"arrowParens": "avoid",
"bracketSameLine": false,
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"htmlWhitespaceSensitivity": "ignore",
"insertPragma": false,
"bracketSameLine": false,
"jsxSingleQuote": false,
"printWidth": 80,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": false,
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "none",
"useTabs": true,
"vueIndentScriptAndStyle": true,
"overrides": [
{
"files": ".prettierrc",
"options": { "parser": "json" }
"files": [
".prettierrc"
],
"options": {
"parser": "json"
}
},
{
"files": [
"*.json"
],
"options": {
"printWidth": 0
}
}
]
}
],
"printWidth": 120,
"proseWrap": "always",
"quoteProps": "preserve",
"requirePragma": false,
"semi": true,
"singleAttributePerLine": true,
"singleQuote": false,
"tabWidth": 4,
"trailingComma": "all",
"useTabs": true,
"vueIndentScriptAndStyle": true
}
4 changes: 3 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module.exports = {
presets: ['@vue/cli-plugin-babel/preset']
"presets": [
"@vue/cli-plugin-babel/preset",
],
};
22 changes: 17 additions & 5 deletions jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,23 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/*": ["./*"],
"@/*": ["./*"],
"~~/*": ["./*"],
"@@/*": ["./*"]
"~/*": [
"./*"
],
"@/*": [
"./*"
],
"~~/*": [
"./*"
],
"@@/*": [
"./*"
]
}
},
"exclude": ["node_modules", ".nuxt", "dist"]
"exclude": [
"node_modules",
".nuxt",
"dist"
]
}
67 changes: 31 additions & 36 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,66 +16,61 @@
</template>

<script>
import PageHeader from './components/Page/PageHeader';
import PageTitle from './components/Page/PageTitle';
import PageFooter from './components/Page/PageFooter';
import PageHeader from "./components/Page/PageHeader";
import PageTitle from "./components/Page/PageTitle";
import PageFooter from "./components/Page/PageFooter";
export default {
components: {
"components": {
PageHeader,
PageTitle,
PageFooter
PageFooter,
},
data() {
return {
isScrollUp: true
"isScrollUp": true,
};
},
watch: {
$route: {
"watch": {
"$route": {
handler(to, from) {
const html = document.getElementsByTagName('html')[0];
const body = document.getElementsByTagName('body')[0];
if (typeof from !== 'undefined') {
html.classList.remove(
'page',
`page-${from.name.toLowerCase()}`
);
const html = document.getElementsByTagName("html")[0];
const body = document.getElementsByTagName("body")[0];
if (typeof from !== "undefined") {
html.classList.remove("page", `page-${from.name.toLowerCase()}`);
}
html.classList.add('page', `page-${to.name.toLowerCase()}`);
body.classList.add('page-body');
html.classList.add("page", `page-${to.name.toLowerCase()}`);
body.classList.add("page-body");
},
immediate: true
}
"immediate": true,
},
},
created() {
this.addSticky();
window.addEventListener('scroll', this.handleScroll);
window.addEventListener("scroll", this.handleScroll);
},
destroyed() {
window.removeEventListener('scroll', this.handleScroll);
window.removeEventListener("scroll", this.handleScroll);
},
methods: {
"methods": {
addSticky() {
const html = document.getElementsByTagName('html')[0];
const body = document.getElementsByTagName('body')[0];
html.classList.add('sticky');
body.classList.add('sticky__body');
const html = document.getElementsByTagName("html")[0];
const body = document.getElementsByTagName("body")[0];
html.classList.add("sticky");
body.classList.add("sticky__body");
},
handleScroll() {
const maxScroll = 95;
window.scrollY >= maxScroll
? this.isScrollUp = false
: this.isScrollUp = true;
}
}
window.scrollY >= maxScroll ? this.isScrollUp = false : this.isScrollUp = true;
},
},
};
</script>

<style lang="scss">
@import './assets/scss/base/_base-reset.scss';
@import './assets/scss/base/_base-fonts.scss';
@import "./assets/scss/base/_base-reset.scss";
@import "./assets/scss/base/_base-fonts.scss";
[v-cloak] {
display: none;
Expand Down Expand Up @@ -181,11 +176,11 @@
padding-top: 8rem;
padding-bottom: 5.2rem;
@include media('md', $dimension: 'height') {
@include media("md", $dimension: "height") {
padding-bottom: 0;
}
@include media('md') {
@include media("md") {
padding-top: 6rem;
padding-bottom: 0;
}
Expand Down
23 changes: 10 additions & 13 deletions src/assets/icomoon/demo-files/demo.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
if (!('boxShadow' in document.body.style)) {
document.body.setAttribute('class', 'noBoxShadow');
if (!("boxShadow" in document.body.style)) {
document.body.setAttribute("class", "noBoxShadow");
}

document.body.addEventListener('click', function(e) {
document.body.addEventListener("click", function(e) {
const target = e.target;
if (
target.tagName === 'INPUT' &&
target.getAttribute('class').indexOf('liga') === -1
) {
if (target.tagName === "INPUT" && target.getAttribute("class").indexOf("liga") === -1) {
target.select();
}
});
(function() {
const fontSize = document.getElementById('fontSize'),
testDrive = document.getElementById('testDrive'),
testText = document.getElementById('testText');
const fontSize = document.getElementById("fontSize"),
testDrive = document.getElementById("testDrive"),
testText = document.getElementById("testText");
function updateTest() {
testDrive.innerHTML = testText.value || String.fromCharCode(160);
if (window.icomoonLiga) {
Expand All @@ -24,8 +21,8 @@ document.body.addEventListener('click', function(e) {
function updateSize() {
testDrive.style.fontSize = `${fontSize.value}px`;
}
fontSize.addEventListener('change', updateSize, false);
testText.addEventListener('input', updateTest, false);
testText.addEventListener('change', updateTest, false);
fontSize.addEventListener("change", updateSize, false);
testText.addEventListener("input", updateTest, false);
testText.addEventListener("change", updateTest, false);
updateSize();
}());
Loading

0 comments on commit 0248bde

Please sign in to comment.