Skip to content

Commit

Permalink
feat: eslint & prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
NafiAsib committed Dec 10, 2023
1 parent de0a0b2 commit 567bb4e
Show file tree
Hide file tree
Showing 16 changed files with 1,773 additions and 240 deletions.
24 changes: 24 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["plugin:astro/recommended"],
parser: "@typescript-eslint/parser",
parserOptions: {
tsconfigRootDir: __dirname,
sourceType: "module",
ecmaVersion: "latest",
},
overrides: [
{
files: ["*.astro"],
parser: "astro-eslint-parser",
parserOptions: {
parser: "@typescript-eslint/parser",
extraFileExtensions: [".astro"],
},
rules: {
// override/add rules settings here, such as:
// "astro/no-set-html-directive": "error"
},
},
],
};
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/**
dist/
13 changes: 13 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"eslint.validate": [
"javascript",
"javascriptreact",
"astro",
"typescript",
"typescriptreact"
],
"prettier.documentSelectors": ["**/*.astro"],
"[astro]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ pnpm i
pnpm dev
```

Open `localhost:4321` in your browser.
Open `localhost:4321` in your browser.
16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,24 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro"
"astro": "astro",
"lint": "prettier --write \"**/*.{js,jsx,ts,tsx,md,mdx,astro}\" && eslint --fix \"src/**/*.{js,ts,jsx,tsx,astro}\""
},
"dependencies": {
"@astrojs/tailwind": "^5.0.0",
"@fontsource/poppins": "^5.0.8",
"astro": "^3.0.8",
"tailwindcss": "^3.0.24"
},
"devDependencies": {
"@typescript-eslint/parser": "^6.13.2",
"eslint": "^8.55.0",
"eslint-plugin-astro": "^0.30.0",
"eslint-plugin-jsx-a11y": "^6.8.0",
"prettier": "^3.1.1",
"prettier-config-standard": "^7.0.0",
"prettier-plugin-astro": "^0.12.2"
}
}
}
Loading

0 comments on commit 567bb4e

Please sign in to comment.