pnpm install --save-dev @gearbox-solutions/eslint-config-gbx
Add the following to your eslint.config.mjs
, which should be in the root of your project.
import gbxConfig from "@gearbox-solutions/eslint-config-gbx";
export default [
...gbxConfig,
// add additional configurations here
];
export default {
plugins: [import('prettier-plugin-tailwindcss')],
printWidth: 120
}
Add the following two script to your package.json file.
You'll need to replace <src>
with the location of the files you'd like ESLint to target. This may be different for each project.
For Laravel projects you will probably want \"resources/js/**/*.{js,ts,vue}\"
for an escaped, quoted string.
"scripts": {
"lint": "eslint <src>",
"lint:fix": "eslint <src> --fix",
"prettier:check": "prettier <src> --check"
"prettier:write": "prettier <src> --write"
},
Will display any errors or warnings ESLint finds in the codebase
npm run lint
Will attempt to fix any errors or warnings that ESLint finds
npm run lint:fix
Format files with Prettier formatting
npm run prettier:write
This package requires peer dependencies to be installed in your project directly. This means that npm link
doesn't work like a regular package would.
To develop this package locally, you'll need to follow these steps:
- Bundle this package with
pnpm pack
- Install the tarball in your project with
pnpm install /path/to/tarball.tgz
When you want to update the package in your project, you'll need to repeat these steps, which should also refresh any dependencies that have changed.
If you make changes to this package, you'll need to publish it to NPM. To do so, follow these steps:
- Update Version in
package.json
- Commit and push changes
- run
npm publish --access public