Skip to content

Commit

Permalink
feat: add eslint and format code
Browse files Browse the repository at this point in the history
  • Loading branch information
GabsEdits committed Jun 12, 2024
1 parent 7d2e810 commit 355425c
Show file tree
Hide file tree
Showing 17 changed files with 918 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* text=auto eol=lf
* text=auto eol=lf
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ node_modules/*
node_modules

cache
dist
dist
8 changes: 5 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.development
.github
scripts
.prettierrc
.prettierignore
.gitattributes
.gitignore
CODE_OF_CONDUCT.md
LEARN.md
docs
docs
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ cache
dist
package.json
pnpm-lock.yaml
public
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"endOfLine": "lf"
"endOfLine": "auto"
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@

### Development Changes

- Add `ESLint` to the project for better code consistency

- Migrate what's possible to the `src` folder

- Make all components styles file begin with an underscore

- Add variables for general styles
- A huge styles cleanup

- Minor changes to the formatter and the linter

## 2.0.2 (2024-06-05)

### Fix(es)
Expand Down
9 changes: 6 additions & 3 deletions Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,23 @@ const { site, frontmatter, page, theme } = useData();
<div
v-if="
frontmatter.layout === 'article' &&
(!theme.minimal || frontmatter.layout !== 'article')
(!theme.minimal || frontmatter.layout !== 'article')
"
>
<ArticleHead />
</div>
<NotFound v-if="page.isNotFound" />
<div v-else :class="frontmatter.pageClass">
<div
v-else
:class="frontmatter.pageClass"
>
<Content />
</div>
<HelpfulLayout v-if="frontmatter.layout == 'helpful'" />
<div
v-if="
frontmatter.layout === 'article' &&
(!theme.minimal || frontmatter.layout !== 'article')
(!theme.minimal || frontmatter.layout !== 'article')
"
>
<ArticleFooter />
Expand Down
15 changes: 15 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import pluginVue from "eslint-plugin-vue";

export default [
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...pluginVue.configs["flat/essential"],
...pluginVue.configs["flat/recommended"],
...pluginVue.configs["flat/strongly-recommended"],
{
files: ["*.vue", "*.ts"],
ignores: ["dist/**", "node_modules/**"],
},
];
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,19 @@
"license": "MIT",
"dependencies": {
"@csstools/normalize.css": "^12.1.1",
"@eslint/js": "^9.4.0",
"eslint": "9.x",
"eslint-plugin-vue": "^9.26.0",
"globals": "^15.4.0",
"inter-ui": "^4.0.2",
"non.geist": "^1.0.3"
},
"scripts": {
"docs:dev": "pnpm --filter=./docs dev",
"docs:build": "pnpm --filter=./docs build",
"docs:preview": "pnpm --filter=./docs preview",
"format": "prettier --write ."
"format": "prettier --write .",
"lint": "eslint . --fix"
},
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit 355425c

Please sign in to comment.