diff --git a/README.md b/README.md index 91b2660..00678fb 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ export default config; @tailwind base; @tailwind components; @tailwind utilities; -@import "keen-slider/keen-slider.min.css"; +@import 'keen-slider/keen-slider.min.css'; * { scroll-behavior: smooth; diff --git a/lint-staged.common.mjs b/lint-staged.common.mjs index 7bcb307..c3a77e4 100644 --- a/lint-staged.common.mjs +++ b/lint-staged.common.mjs @@ -1,7 +1,4 @@ import path from 'path'; -import { quote } from 'shell-quote'; - -const isWin = process.platform === 'win32'; const eslintGlobalRulesForFix = [ // react-hooks/eslint and react in general is very strict about exhaustively @@ -62,19 +59,3 @@ export const getEslintFixCmd = ({ ].join(' '); return `eslint ${args}`; }; - -/** - * Concatenate and escape a list of filenames that can be passed as args to prettier cli - * - * Prettier has an issue with special characters in filenames, - * such as the ones uses for nextjs dynamic routes (ie: [id].tsx...) - * - * @link https://github.com/okonet/lint-staged/issues/676 - * - * @param {string[]} filenames - * @returns {string} Return concatenated and escaped filenames - */ -export const concatFilesForPrettier = (filenames) => - filenames - .map((filename) => `"${isWin ? filename : quote([filename])}"`) - .join(' '); diff --git a/lint-staged.config.mjs b/lint-staged.config.mjs index 2a40c06..62f2727 100644 --- a/lint-staged.config.mjs +++ b/lint-staged.config.mjs @@ -5,10 +5,7 @@ import { fileURLToPath } from 'node:url'; * A good practice is to override this base configuration in each package and/or application * where we are able to add customization depending on the nature of the project (eslint...). */ -import { - concatFilesForPrettier, - getEslintFixCmd, -} from './lint-staged.common.mjs'; +import { getEslintFixCmd } from './lint-staged.common.mjs'; /** * @type {Record string | string[] | Promise>} @@ -26,11 +23,6 @@ const rules = { files: filenames, }); }, - '**/*.{json,md,mdx,css,html,yml,yaml,scss,ts,js,tsx,jsx,mjs}': ( - filenames - ) => { - return [`prettier --write ${concatFilesForPrettier(filenames)}`]; - }, }; export default rules; diff --git a/package.json b/package.json index 8508f3f..b7915d1 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,6 @@ "lint-staged": "15.2.5", "npm-run-all": "^4.1.5", "postcss": "^8.4.38", - "prettier": "^3.2.5", "shell-quote": "1.8.1", "tsup": "^8.0.2", "typescript": "^5.4.5", diff --git a/yarn.lock b/yarn.lock index 50687f3..3fdd9b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -959,7 +959,6 @@ __metadata: npm-run-all: "npm:^4.1.5" postcss: "npm:^8.4.38" postcss-js: "npm:^4.0.1" - prettier: "npm:^3.2.5" sade: "npm:^1.8.1" shell-quote: "npm:1.8.1" tsup: "npm:^8.0.2"