Skip to content

Commit

Permalink
eslint 9
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaliytv committed Jun 18, 2024
1 parent 0a3816a commit 2a88b3a
Show file tree
Hide file tree
Showing 9 changed files with 2,096 additions and 2,009 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
YARN_CHECKSUM_BEHAVIOR: ignore

- name: Eslint
run: yarn dlx eslint . --ext .js
run: yarn dlx eslint .
874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.3.cjs

This file was deleted.

894 changes: 894 additions & 0 deletions .yarn/releases/yarn-4.3.0.cjs

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
compressionLevel: mixed

enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.6.3.cjs
yarnPath: .yarn/releases/yarn-4.3.0.cjs
3 changes: 3 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { getConfig } from '@nitra/eslint-config'

export default [...getConfig({ vite: ['npm'], node: ['demo'] })]
2 changes: 1 addition & 1 deletion npm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nitra/parse-phone",
"version": "1.2.0",
"version": "1.3.0",
"description": "make world phone number (Ru, Ukr)",
"type": "module",
"exports": {
Expand Down
9 changes: 4 additions & 5 deletions npm/src/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
/**
* Перетворення номера на міжнародний формат
*
* @param {String} phone
* @return {String|null} Телефон у міжнародному форматі або null якщо не розпізнано
* @param {string} phone
* @returns {string | null} Телефон у міжнародному форматі або null якщо не розпізнано
*/
export const parsePhone = phone => {
if (!phone) {
return null
}

/** @type {String} */
/** @type {string} */
let phoneStr

// З "+7 913 065 89 17" трансформуємо в "79130658917"
phoneStr = phone.replace(/[^0-9]/g, '')
phoneStr = phone.replaceAll(/\D/g, '')

// Прибираємо 2 нулі на початку рядка
phoneStr = phoneStr.replace(/^00/, '')
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"root": true
},
"devDependencies": {
"@nitra/cspell-dict": "^1.0.70",
"@nitra/eslint-config": "^1.0.24",
"@nitra/cspell-dict": "^1.0.136",
"@nitra/eslint-config": "^2.0.26",
"@nitra/prettier-config": "^1.0.1"
},
"license": "MIT",
"packageManager": "yarn@3.6.3"
"packageManager": "yarn@4.3.0"
}
Loading

0 comments on commit 2a88b3a

Please sign in to comment.