Skip to content

Commit

Permalink
chore: update eslint (#202)
Browse files Browse the repository at this point in the history
* chore: update eslint

* fix: use correct prettier config in npm command
  • Loading branch information
BobbieGoede authored May 27, 2024
1 parent 7550bd5 commit c356e32
Show file tree
Hide file tree
Showing 10 changed files with 257 additions and 245 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

33 changes: 0 additions & 33 deletions .eslintrc.js

This file was deleted.

6 changes: 0 additions & 6 deletions .prettierrc

This file was deleted.

38 changes: 38 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// @ts-check

import tseslint from 'typescript-eslint'
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'

export default tseslint.config(
// base configuration
{
files: ['**/*.ts'],
ignores: ['./lib'],
languageOptions: {
globals: {
page: true,
browser: true,
context: true
}
}
},

// setup typescript rules
...tseslint.configs.recommended,

// setup prettier, includes eslint-config-prettier
eslintPluginPrettierRecommended,

// custom rules
{
rules: {
'object-curly-spacing': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/member-delimiter-style': 'off',
'@typescript-eslint/no-use-before-define': 'off'
}
}
)
2 changes: 1 addition & 1 deletion example/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
Expand Down
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
"@microsoft/api-extractor": "^7.18.4",
"@secretlint/secretlint-rule-preset-recommend": "^3.3.0",
"@types/node": "^18.11.17",
"@typescript-eslint/eslint-plugin": "^5.46.1",
"@typescript-eslint/parser": "^5.46.1",
"@vitest/coverage-v8": "^1.6.0",
"@vue/compiler-core": "^3.2.45",
"@vue/compiler-sfc": "^3.2.45",
Expand All @@ -44,19 +42,20 @@
"@vue/server-renderer": "^3.2.45",
"api-docs-gen": "^0.4.0",
"esbuild-register": "^3.5.0",
"eslint": "^8.30.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint": "^9.2.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"get-port-please": "^3.1.2",
"jsdom": "^24.0.0",
"lint-staged": "^11.0.0",
"npm-run-all2": "^5.0.0",
"opener": "^1.5.2",
"playwright": "^1.44.0",
"prettier": "^2.8.1",
"prettier": "^3.2.5",
"secretlint": "^3.3.0",
"shipjs": "^0.26.0",
"typescript": "^4.9.1",
"typescript": "^5.4.5",
"typescript-eslint": "^7.9.0",
"vitest": "^1.6.0",
"vue": "^3.2.45",
"vue-loader": "^16.2.0",
Expand Down Expand Up @@ -115,10 +114,10 @@
"coverage": "opener coverage/lcov-report/index.html",
"example": "webpack serve --config example/webpack.config.js --inline --hot",
"fix": "npm-run-all --parallel lint:eslint:fix format:fix",
"format": "prettier --config .prettierrc --ignore-path .prettierignore --list-different '**/*.{js,json,html}'",
"format": "prettier --config prettier.config.mjs --ignore-path .prettierignore --list-different '**/*.{js,json,html}'",
"format:fix": "pnpm format --write",
"lint": "npm-run-all --parallel lint:eslint lint:secret",
"lint:eslint": "eslint ./src ./test --ext .ts --cache",
"lint:eslint": "eslint ./src ./test",
"lint:eslint:fix": "pnpm lint:eslint --fix",
"lint:secret": "npx secretlint \"**/*\"",
"release:prepare": "shipjs prepare",
Expand Down
Loading

0 comments on commit c356e32

Please sign in to comment.