Skip to content

Commit

Permalink
chore: migrate to reusable configs
Browse files Browse the repository at this point in the history
  • Loading branch information
ilfa committed Jan 26, 2024
1 parent 34e78b3 commit dcd800c
Show file tree
Hide file tree
Showing 9 changed files with 275 additions and 202 deletions.
22 changes: 1 addition & 21 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,22 @@
module.exports = {
env: {
browser: true,
es6: true,
node: true,
},
extends: [
'next/core-web-vitals',
'@fingerprintjs/eslint-config-dx-team',
'plugin:react/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:react-hooks/recommended',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2020,
sourceType: 'module',
},
settings: {
react: {
version: 'detect',
},
},
plugins: ['@typescript-eslint', 'prettier'],
ignorePatterns: ['build/*'],
rules: {
semi: ['error', 'never'],
'linebreak-style': ['error', 'unix'],
'react/display-name': 'off',
'prefer-const': 'error',
'react/self-closing-comp': [
'error',
{
Expand All @@ -42,9 +25,6 @@ module.exports = {
},
],
'react/react-in-jsx-scope': 'off',
'prettier/prettier': 'error',
'@typescript-eslint/no-unused-vars': ['error'],
'@next/next/no-html-link-for-pages': 'off',
curly: [2, 'all'],
},
}
13 changes: 1 addition & 12 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
{
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"jsxSingleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "always"
}
"@fingerprintjs/prettier-config-dx-team"
85 changes: 3 additions & 82 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -10,93 +10,14 @@
[
"@semantic-release/commit-analyzer",
{
"releaseRules": [
{
"type": "build",
"scope": "deps",
"release": "patch"
},
{
"type": "docs",
"scope": "README",
"release": "patch"
}
]
"config": "@fingerprintjs/conventional-changelog-dx-team",
"releaseRules": "@fingerprintjs/conventional-changelog-dx-team/release-rules"
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalCommits",
"presetConfig": {
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "feature",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "perf",
"section": "Performance Improvements"
},
{
"type": "revert",
"section": "Reverts"
},
{
"type": "docs",
"scope": "README",
"section": "Documentation"
},
{
"type": "build",
"scope": "deps",
"section": "Build System"
},
{
"type": "docs",
"section": "Documentation",
"hidden": true
},
{
"type": "style",
"section": "Styles",
"hidden": true
},
{
"type": "chore",
"section": "Miscellaneous Chores",
"hidden": true
},
{
"type": "refactor",
"section": "Code Refactoring",
"hidden": true
},
{
"type": "test",
"section": "Tests",
"hidden": true
},
{
"type": "build",
"section": "Build System",
"hidden": true
},
{
"type": "ci",
"section": "Continuous Integration",
"hidden": true
}
]
}
"config": "@fingerprintjs/conventional-changelog-dx-team"
}
],
"@semantic-release/changelog",
Expand Down
11 changes: 5 additions & 6 deletions __tests__/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ export const getDefaultLoadOptions = () => ({

export const createWrapper =
({ loadOptions = getDefaultLoadOptions(), ...options }: Partial<FpjsClientOptions> = {}) =>
({ children }: PropsWithChildren<{}>): JSX.Element =>
(
<FpjsProvider loadOptions={loadOptions} {...options}>
{children}
</FpjsProvider>
)
({ children }: PropsWithChildren<{}>): JSX.Element => (
<FpjsProvider loadOptions={loadOptions} {...options}>
{children}
</FpjsProvider>
)

export const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))

Expand Down
2 changes: 1 addition & 1 deletion __tests__/with-environment.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FunctionComponent } from 'react'
import { FunctionComponent } from 'react'
import { act, render } from '@testing-library/react'
import { WithEnvironment } from '../src/components/with-environment'
import { Link, MemoryRouter, Route, Routes } from 'react-router-dom'
Expand Down
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] }
module.exports = { extends: ['@fingerprintjs/commit-lint-dx-team'] }
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@
},
"devDependencies": {
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@fingerprintjs/commit-lint-dx-team": "^0.0.2",
"@fingerprintjs/conventional-changelog-dx-team": "^0.1.0",
"@fingerprintjs/eslint-config-dx-team": "^0.1.0",
"@fingerprintjs/prettier-config-dx-team": "^0.1.0",
"@fingerprintjs/tsconfig-dx-team": "^0.0.2",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-typescript": "^11.1.6",
"@testing-library/preact": "^3.2.3",
Expand All @@ -71,21 +75,17 @@
"@typescript-eslint/eslint-plugin": "^5.50.0",
"@typescript-eslint/parser": "^5.50.0",
"commitizen": "^4.2.4",
"conventional-changelog-conventionalcommits": "5.0.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.33.0",
"eslint-config-next": "13.1.6",
"eslint": "^8.0.0",
"eslint-config-next": "14.1.0",
"eslint-config-preact": "^1.3.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "7.32.2",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"husky": "^8.0.1",
"jest": "^27.5.1",
"jest-environment-jsdom": "^27.5.1",
"lint-staged": "^13.0.3",
"preact": "^10.11.0",
"prettier": "^2.8.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.4.2",
Expand All @@ -96,7 +96,7 @@
"rollup-plugin-license": "^3.2.0",
"rollup-plugin-peer-deps-external": "^2.2.4",
"ts-jest": "^27.1.5",
"tslib": "^2.5.0",
"tslib": "^2.6.2",
"typedoc": "^0.25.7",
"typescript": "^5.3.3"
},
Expand Down
Loading

0 comments on commit dcd800c

Please sign in to comment.