Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,14 @@
"devDependencies": ["**/__tests__/*", "rollup.config.mjs"]
}
]
}
},
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"parserOptions": {
"project": ["tsconfig.json"]
},
"extends": ["./packages/eslint-config-react/typescript.js"]
}
]
}
2 changes: 1 addition & 1 deletion babel.config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"],
"presets": ["@babel/preset-typescript", "@babel/preset-env", "@babel/preset-react"],
"plugins": ["@babel/plugin-transform-runtime"]
}
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
"@babel/plugin-transform-runtime": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"@babel/preset-react": "^7.13.13",
"@babel/preset-typescript": "^7.14.5",
"@commitlint/cli": "^12.0.0",
"@commitlint/config-conventional": "^12.0.0",
"@rollup/plugin-babel": "^5.2.2",
"@rollup/plugin-node-resolve": "^13.0.0",
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^12.0.0",
"@testing-library/react-hooks": "^7.0.0",
"@types/react-router-dom": "^5.1.8",
"builtin-modules": "^3.2.0",
"cross-env": "^7.0.3",
"eslint": "^7.18.0",
Expand All @@ -30,10 +32,12 @@
"prettier": "^2.2.1",
"read-pkg": "^6.0.0",
"rollup": "^2.36.1",
"rollup-plugin-visualizer": "^5.5.0"
"rollup-plugin-dts": "^3.0.2",
"rollup-plugin-visualizer": "^5.5.0",
"typescript": "^4.3.5"
},
"scripts": {
"lint": "eslint --cache .",
"lint": "eslint --ext js,ts,tsx --cache .",
"lint:fix": "yarn run lint --fix",
"build": "lerna exec --stream --ignore @scaleway/eslint-* --ignore @scaleway/countries -- rollup -c ../../rollup.config.mjs",
"build:profile": "cross-env PROFILE=true yarn run build",
Expand Down Expand Up @@ -65,7 +69,7 @@
"jest-localstorage-mock"
],
"collectCoverageFrom": [
"packages/*/src/**/*.{js,jsx}"
"packages/*/src/**/*.{ts,tsx,js,jsx}"
],
"modulePathIgnorePatterns": [
"locales"
Expand Down
7 changes: 4 additions & 3 deletions packages/random-name/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"version": "1.3.2",
"description": "A small utility to generate a random name",
"type": "module",
"main": "dist/module.js",
"module": "dist/module.js",
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"browser": {
"dist/module.js": "./dist/module.browser.js"
"dist/index.js": "./dist/index.browser.js"
},
"publishConfig": {
"access": "public"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('randomNames', () => {
})

it('should never includes the word "cocks"', () => {
const names = Array.from(Array(1000000), randomName)
const names = Array.from(Array(1000000), () => randomName())
expect(names).not.toEqual(
expect.arrayContaining([expect.stringMatching('cocks')]),
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import dockerNames from 'docker-names'

const randomName = (prefix = '', separator = '-') => {
const randomName = (prefix = '', separator = '-'): string => {
let random = dockerNames.getRandomName().replace(/_/g, separator)
while (random.includes('cocks')) {
random = dockerNames.getRandomName().replace(/_/g, separator)
Expand Down
7 changes: 4 additions & 3 deletions packages/regex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"version": "1.4.3",
"description": "A small utility to use regex",
"type": "module",
"main": "dist/module.js",
"module": "dist/module.js",
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"browser": {
"dist/module.js": "./dist/module.browser.js"
"dist/index.js": "./dist/index.browser.js"
},
"publishConfig": {
"access": "public"
Expand Down
Loading