Skip to content

Commit

Permalink
Expand linting configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
dbtedman committed Dec 5, 2023
1 parent 648b8ff commit d49023d
Show file tree
Hide file tree
Showing 6 changed files with 287 additions and 52 deletions.
36 changes: 0 additions & 36 deletions .eslintrc.js

This file was deleted.

37 changes: 37 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
root: true

parser: "@typescript-eslint/parser"

plugins:
- "unused-imports"

extends:
- "eslint:recommended"
- "plugin:@typescript-eslint/eslint-recommended"
- "plugin:@typescript-eslint/recommended"
- "prettier"
- "plugin:jest/recommended"
- "plugin:security-node/recommended"
- "plugin:promise/recommended"
- "plugin:import/recommended"
- "plugin:jsx-a11y/recommended"

settings:
import/resolver:
typescript: true
node: true

rules:
# Our tests rely frequently on assertions defined in external file.
"jest/expect-expect": "off"
# Consistent import order and spacing of imports.
"import/order":
- "error"
- "newlines-between": "always-and-inside-groups"
"unused-imports/no-unused-imports": "error"
"unused-imports/no-unused-vars": "warn"

env:
browser: true
node: true
6 changes: 0 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@ Tested using [Jest](https://jestjs.io/), using test cases defined in the `src/`
make test
```

Our test suite contains the following kinds of tests:

- **Unit** - Does each unit of code perform its intended purpose, and do we handle potential error cases correctly.
- **Integration** - Can our plugin be loaded into PostCSS and then executed correctly.
- **Acceptance** - Does our plugin perform the correct operations based on provided configuration.

## Publishing

[![NPM Downloads Per Week](https://img.shields.io/npm/dw/postcss-prefixwrap?color=blue&logo=npm&style=for-the-badge)](https://www.npmjs.com/package/postcss-prefixwrap)
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@
"scripts": {
"build": "tsc --build tsconfig.app.json",
"clean": "node automation-clean.js",
"format": "sort-package-json && prettier . --write && pnpm eslint --fix . --ext .js,.ts",
"lint": "sort-package-json --check && prettier . --check && pnpm eslint . --ext .js,.ts",
"format": "sort-package-json && prettier . --write && eslint --fix . --ext .js,.ts",
"lint": "sort-package-json --check && prettier . --check && eslint . --ext .js,.ts",
"prepare": "husky install",
"test": "jest"
},
"devDependencies": {
"@babel/core": "7.23.5",
"@jest/globals": "29.7.0",
"@tsconfig/node18": "18.2.2",
"@types/jest": "29.5.10",
"@types/node": "20.10.3",
"@typescript-eslint/eslint-plugin": "6.13.2",
Expand All @@ -46,8 +47,10 @@
"eslint-import-resolver-typescript": "3.6.1",
"eslint-plugin-import": "2.29.0",
"eslint-plugin-jest": "27.6.0",
"eslint-plugin-jsx-a11y": "6.8.0",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-security-node": "1.1.1",
"eslint-plugin-unused-imports": "3.0.0",
"glob": "10.3.10",
"husky": "8.0.3",
"jest": "29.7.0",
Expand Down
Loading

0 comments on commit d49023d

Please sign in to comment.