Skip to content

Commit

Permalink
chore: update config, format and cleanup (#46)
Browse files Browse the repository at this point in the history
Co-authored-by: Anna <[email protected]>
  • Loading branch information
raisedadead and a2937 authored Apr 2, 2024
1 parent 7686f0f commit 65514cd
Show file tree
Hide file tree
Showing 18 changed files with 305 additions and 136 deletions.
15 changes: 15 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Deep Directories
**/node_modules

# Generated Directories
**/dist
**/.astro
**/__coverage__

# Directories
.changeset

# Files
pnpm-lock.yaml
pre-commit
.prettierignore
46 changes: 46 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
module.exports = {
env: {
browser: true,
es2022: true,
node: true
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:astro/recommended',
'prettier'
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
},
rules: {},
plugins: ['@typescript-eslint'],
overrides: [
{
env: {
node: true
},
files: ['.eslintrc.{js,cjs}'],
parserOptions: {
sourceType: 'script'
}
},
{
files: ['*.astro'],
parser: 'astro-eslint-parser',
processor: 'astro/client-side-ts',
parserOptions: {
parser: '@typescript-eslint/parser',
extraFileExtensions: ['.astro']
},
rules: {}
},
{
files: ['*.d.ts'],
rules: {
'@typescript-eslint/triple-slash-reference': 'off'
}
}
]
};
21 changes: 0 additions & 21 deletions .eslintrc.json

This file was deleted.

1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@
pnpm-lock.yaml
pre-commit
.prettierignore

22 changes: 4 additions & 18 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
{
"printWidth": 100,
"endOfLine": "lf",
"semi": true,
"singleQuote": true,
"jsxSingleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false,
"plugins": ["prettier-plugin-astro"],
"overrides": [
{
"files": [".*", "*.json", "*.md"],
"options": {
"useTabs": false
}
},
{
"files": ["*.md", "*.mdx"],
"options": {
"printWidth": 80
}
}
]
"trailingComma": "none",
"arrowParens": "avoid"
}
19 changes: 10 additions & 9 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,33 @@ export default defineConfig({
description: 'Contribute to freeCodeCamp.org',
logo: {
src: './public/icons/icon-96x96.png',
replacesTitle: true,
replacesTitle: true
},
tableOfContents: true,
defaultLocale: 'en',
editLink: {
baseUrl: 'https://github.com/freeCodeCamp/contribute/edit/main/',
baseUrl: 'https://github.com/freeCodeCamp/contribute/edit/main/'
},
social: {
github: 'https://github.com/freeCodeCamp',
twitter: 'https://twitter.com/freeCodeCamp',
discord: 'https://discord.com/invite/freecodecamp-org-official-fi-fo-692816967895220344',
discord:
'https://discord.com/invite/freecodecamp-org-official-fi-fo-692816967895220344'
},
sidebar: sidebar,
components: {
// Override the default `SocialIcons` component.
Header: './src/components/FCCHeader.astro',
ThemeProvider: './src/components/FCCThemeProvider.astro',
ThemeProvider: './src/components/FCCThemeProvider.astro'
},
customCss: [
// Relative path to your custom CSS file
'./src/styles/theme.css',
],
}),
'./src/styles/theme.css'
]
})
],
output: 'hybrid',
adapter: cloudflare({
imageService: 'passthrough',
}),
imageService: 'passthrough'
})
});
20 changes: 14 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@
"type": "module",
"version": "1.0.0",
"scripts": {
"dev": "astro dev",
"preinstall": "npx only-allow pnpm",
"prepare": "is-ci || husky",
"dev": "pnpm run develop",
"develop": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"preview": "wrangler pages dev ./dist",
"astro": "astro",
"format": "prettier -w --cache --plugin prettier-plugin-astro .",
"prepare": "husky",
"lint": "eslint --cache --max-warnings 0 ."
"format": "prettier . --write --cache && eslint . --cache --fix",
"lint": "prettier . --check --cache && eslint . --cache"
},
"lint-staged": {
"*": "prettier -w --cache --plugin prettier-plugin-astro ."
"**/*.{astro, mjs,cjs,js,jsx,ts,tsx,yaml,yml}": [
"pnpm format"
]
},
"dependencies": {
"@astrojs/check": "^0.5.10",
Expand All @@ -23,10 +27,14 @@
"typescript": "^5.4.3"
},
"devDependencies": {
"@typescript-eslint/parser": "^7.4.0",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-astro": "^0.33.1",
"eslint-plugin-prettier": "^5.1.3",
"husky": "^9.0.11",
"is-ci": "^3.0.1",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"prettier-plugin-astro": "^0.13.0",
Expand Down
Loading

0 comments on commit 65514cd

Please sign in to comment.