Skip to content
This repository has been archived by the owner on Feb 15, 2025. It is now read-only.

Commit

Permalink
convert prettier to eslint plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jalling97 committed Apr 26, 2024
1 parent 03cdee8 commit 7021fcf
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 27 deletions.
14 changes: 6 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ repos:
rev: v8.56.0
hooks:
- id: eslint
files: \.(js|jsx|ts|tsx|svelte)$ # apply eslint to the provided filetypes
name: ESLint and Prettier
files: \.(js|jsx|ts|tsx|svelte|cjs|mjs)$ # *.js, *.jsx, *.ts, *.tsx and *.svelte
types: [file]

# Prettier Code formatter
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
hooks:
- id: prettier
files: \.(js|jsx|ts|tsx|svelte)$ # apply prettier to the provided filetypes
additional_dependencies:
- [email protected]
- [email protected]
- [email protected]
7 changes: 4 additions & 3 deletions src/leapfrogai_ui/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ module.exports = {
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended',
'prettier'
'plugin:prettier/recommended'
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
plugins: ['@typescript-eslint', 'prettier', 'svelte'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
Expand All @@ -29,6 +29,7 @@ module.exports = {
}
],
rules: {
'no-undef': 'off'
'no-undef': 'off',
'prettier/prettier': 'error'
}
};
1 change: 0 additions & 1 deletion src/leapfrogai_ui/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
2 changes: 1 addition & 1 deletion src/leapfrogai_ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ ENV NODE_ENV=production
ENV BODY_SIZE_LIMIT=Infinity
ENV PROTOCOL_HEADER=x-forwarded-proto
ENV HOST_HEADER=x-forwarded-host
CMD ["build"]
CMD ["build"]
2 changes: 1 addition & 1 deletion src/leapfrogai_ui/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ docker-build:
docker build -t ghcr.io/defenseunicorns/leapfrogai/leapfrogai-ui:${VERSION} .

zarf-build:
zarf package create . --confirm --set IMAGE_VERSION=${VERSION}
zarf package create . --confirm --set IMAGE_VERSION=${VERSION}
83 changes: 74 additions & 9 deletions src/leapfrogai_ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions src/leapfrogai_ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"test": "npm run test:integration && npm run test:unit",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
"format": "prettier --write .",
"lint": "eslint .",
"format": "eslint . --fix",
"test:integration": "playwright test",
"test:integration:ui": "playwright test --ui",
"test:unit": "vitest run",
Expand Down Expand Up @@ -42,11 +42,10 @@
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.35.1",
"eslint-plugin-prettier": "5.0.0",
"husky": "^9.0.11",
"jsdom": "^24.0.0",
"otpauth": "^9.2.2",
"prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2",
"sass": "^1.71.1",
"svelte": "^4.2.12",
"svelte-check": "^3.6.9",
Expand Down

0 comments on commit 7021fcf

Please sign in to comment.