ESLint config for Playwright + TypeScript + Prettier projects, with Unicorn and Sonar plugins.
Modern Eslint + Prettier setup for Playwright Typescript projects, with SonarJS and ESLint Unicorn plugins.
It tries to be very agnostic while at the same time use all the available, very opinionated tools from the community, to enforce and automate code quality standards and conventions.
Check out the mono-repo @meowsos/playwright-eslint-prettier-setup for the rest of the setup and installation instructions
-
Install the package:
npm install --save-dev @meowsos/eslint-config
-
Add the following to your
.eslintrc.js
file:module.exports = { extends: ['@meowsos/eslint-config'], }
-
Add the following to your
package.json
file:{ "scripts": { "lint": "eslint . --ext .ts,.tsx", "lint:fix": "eslint . --ext .ts,.tsx --fix" } }
-
Run the following command to lint your code:
npm run lint
Here is a simplified breakdown of each of the dependencies with URLs to the packages in npm.js:
-
"@playwright/test": This is a library for writing and executing tests using Playwright, a web playwright framework. (URL: https://www.npmjs.com/package/@playwright/test)
-
"@types/node": This is a package that provides type definitions for the Node.js core libraries. (URL: https://www.npmjs.com/package/@types/node)
-
"@typescript-eslint/eslint-plugin": This is an ESLint plugin for TypeScript. (URL: https://www.npmjs.com/package/@typescript-eslint/eslint-plugin)
-
"@typescript-eslint/parser": This is the TypeScript parser for ESLint. (URL: https://www.npmjs.com/package/@typescript-eslint/parser)
-
"eslint-config-prettier": This is an ESLint configuration that integrates with Prettier, a code formatter. (URL: https://www.npmjs.com/package/eslint-config-prettier)
-
"eslint-plugin-playwright": This is an ESLint plugin that provides rules for specifically testing with Playwright. (URL: https://www.npmjs.com/package/eslint-plugin-playwright)
-
"eslint-plugin-prettier": This is an ESLint plugin that integrates with Prettier. (URL: https://www.npmjs.com/package/eslint-plugin-prettier)
-
"eslint-plugin-sonarjs": This is an ESLint plugin that provides rules for static code analysis using SonarQube, a popular code quality platform. (URL: https://www.npmjs.com/package/eslint-plugin-sonarjs)
-
"eslint-plugin-unicorn": This is an ESLint plugin that provides a set of stricter rules for writing clean and maintainable JavaScript code. (URL: https://www.npmjs.com/package/eslint-plugin-unicorn)
-
"eslint": This is the core ESLint package. (URL: https://www.npmjs.com/package/eslint)
-
"prettier": This is a code formatter that automatically formats code to a consistent style. (URL: https://www.npmjs.com/package/prettier)
-
"typescript": This is the TypeScript compiler. (URL: https://www.typescriptlang.org)
ISC License (ISC)
Meowso m3au@pm.me (http://about.me/bpalma)
- Manonmani Ramu mananmani.ramu@gmail.com
- clean:
npx delete-empty && git clean -fXd
- bump:
npx npm-check-updates -u && npm install
- publish-manual:
npm publish