Skip to content

Commit

Permalink
feat: add @nl-design-system/eslint-config
Browse files Browse the repository at this point in the history
Add a new package @nl-design-system/eslint-config and immediately eat
our own dogfood by using it in the basis repo itself.

eslint-plugin-import was more or less replaced by
eslint-plugin-perfectionist that provides similar functionality and
more.

Rename config files for tools that support importing their config
instead of requiring it.

Improve lint-staged by running both prettier and eslint (and stylelint)
on files that support both.
  • Loading branch information
matijs authored and Robbert committed Nov 7, 2024
1 parent 3608dfc commit bec1e03
Show file tree
Hide file tree
Showing 15 changed files with 928 additions and 1,865 deletions.
17 changes: 0 additions & 17 deletions .eslintignore

This file was deleted.

115 changes: 0 additions & 115 deletions .eslintrc.js.json

This file was deleted.

93 changes: 0 additions & 93 deletions .eslintrc.json

This file was deleted.

8 changes: 0 additions & 8 deletions .eslintrc.react.json

This file was deleted.

2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pnpm exec lint-staged
lint-staged
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from '@nl-design-system/eslint-config';
7 changes: 0 additions & 7 deletions lint-staged.config.cjs

This file was deleted.

7 changes: 7 additions & 0 deletions lint-staged.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
'*.{css,scss}': ['stylelint --allow-empty-input --fix', 'prettier --write'],
'*.{js,cjs,mjs,json,jsx,mdx,ts,tsx}': ['eslint --no-error-on-unmatched-pattern --fix', 'prettier --write'],
'*.{yml,yaml}': 'prettier --write',
'*.md': ['markdownlint', 'prettier --write'],
'package.json': 'npmPkgJsonLint --allowEmptyTargets',
};
12 changes: 4 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,12 @@
},
"devDependencies": {
"@changesets/cli": "2.27.8",
"@nl-design-system/eslint-config": "workspace:*",
"@nl-design-system/tsconfig": "workspace:*",
"@types/node": "20.14.13",
"@typescript-eslint/eslint-plugin": "8.6.0",
"@typescript-eslint/parser": "8.6.0",
"eslint": "8.57.1",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.30.0",
"eslint-plugin-json": "3.1.0",
"eslint-plugin-mdx": "3.1.5",
"eslint-plugin-react": "7.36.1",
"eslint": "9.13.0",
"husky": "9.1.6",
"lint-staged": "15.2.10",
"markdownlint-cli": "0.41.0",
Expand All @@ -48,13 +44,13 @@
"clean": "pnpm --recursive run clean",
"lint": "npm-run-all --continue-on-error lint:** lint-workspaces",
"lint:css": "stylelint --allow-empty-input '**/*.{css,scss}'",
"lint:js": "eslint --ext .js,.cjs,.mjs,.json,.jsx,.mdx,.ts,.tsx --report-unused-disable-directives .",
"lint:js": "eslint",
"lint:md": "markdownlint '**/*.md'",
"lint:package-json": "npmPkgJsonLint .",
"lint:package-lock": "pnpm ls --recursive",
"lint-fix": "npm-run-all --continue-on-error lint-fix:** prettier",
"lint-fix:css": "stylelint --fix '**/*.{css,scss}'",
"lint-fix:js": "eslint --ext .js,.cjs,.mjs,.json,.jsx,.mdx,.ts,.tsx --fix --report-unused-disable-directives .",
"lint-fix:js": "eslint --fix",
"lint-fix:md": "markdownlint --fix '**/*.md'",
"lint-workspaces": "pnpm --recursive --if-present run lint",
"lint-build": "pnpm --recursive --if-present run lint-build",
Expand Down
Loading

0 comments on commit bec1e03

Please sign in to comment.