Skip to content

Commit

Permalink
chore: Updated eslint to v9
Browse files Browse the repository at this point in the history
  • Loading branch information
cmath10 committed Oct 19, 2024
1 parent 53e1b8d commit a2daa1f
Show file tree
Hide file tree
Showing 5 changed files with 253 additions and 237 deletions.
25 changes: 0 additions & 25 deletions .eslintrc.js

This file was deleted.

33 changes: 33 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import globals from 'globals'
import pluginJs from '@eslint/js'
import pluginTs from 'typescript-eslint'

export default [
{ files: ['**/*.{js,mjs,cjs,ts,mts}'] },
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
},
pluginJs.configs.recommended,
...pluginTs.configs.recommended,
{
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-empty-function': 'off',
'comma-dangle': ['error', {
arrays: 'always-multiline',
exports: 'always-multiline',
functions: 'never',
imports: 'always-multiline',
objects: 'always-multiline',
}],
'no-debugger': 'error',
'object-curly-spacing': ['error', 'always'],
'quotes': ['error', 'single'],
},
},
]
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"types": "types/index.d.ts",
"scripts": {
"build": "rollup --config rollup.config.ts --configPlugin typescript",
"lint": "eslint --ext .js,.mjs,.ts src tests types",
"lint": "eslint src tests types",
"prepare": "husky",
"release": "standard-version",
"release:minor": "standard-version --release-as minor",
Expand All @@ -21,19 +21,20 @@
"devDependencies": {
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0",
"@eslint/js": "^9.13.0",
"@rollup/plugin-alias": "^5.1.0",
"@rollup/plugin-typescript": "^11.1.6",
"@types/node": "^18.15 || ^20.11",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"eslint": "^8.56.0",
"eslint": "^9.13.0",
"globals": "^15.11.0",
"husky": "^9.0.10",
"rollup": "^4.9.6",
"rollup-plugin-delete": "^2.0.0",
"standard-version": "^9.5.0",
"ts-node": "^10.9.2",
"tslib": "^2.6.2",
"typescript": "^5.3.3",
"typescript-eslint": "^8.10.0",
"vite": "^5.4.9",
"vite-plugin-dts": "^4.2.4",
"vitest": "^2.1.3"
Expand Down
2 changes: 1 addition & 1 deletion src/predicates/isEmail.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import isString from '@/predicates/isString'

const pattern = /^(([^<>()\[\].,;:\s@"]+(\.[^<>()\[\].,;:\s@"]+)*)|(".+"))@(([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{2,})$/i
const pattern = /^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@(([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{2,})$/i

/** Checks if a value is an email */
export default (value: unknown): value is string => isString(value) && pattern.test(value)
Loading

0 comments on commit a2daa1f

Please sign in to comment.