Skip to content

Commit

Permalink
Merge pull request #81 from builder-group/80-migrate-to-eslint-9
Browse files Browse the repository at this point in the history
Migrate to Eslint 9
  • Loading branch information
bennobuilder authored Nov 28, 2024
2 parents a04b36e + 3b84711 commit adf6089
Show file tree
Hide file tree
Showing 293 changed files with 8,997 additions and 10,109 deletions.
21 changes: 21 additions & 0 deletions .changeset/eighty-lies-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
'google-webfonts-client': patch
'validation-adapters': patch
'validation-adapter': patch
'elevenlabs-client': patch
'feature-logger': patch
'@blgc/openapi-router': patch
'feature-fetch': patch
'feature-react': patch
'feature-state': patch
'figma-connect': patch
'xml-tokenizer': patch
'eprel-client': patch
'feature-form': patch
'@blgc/config': patch
'@blgc/types': patch
'@blgc/utils': patch
'@blgc/cli': patch
---

Migrated to Eslint 9
30 changes: 3 additions & 27 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,7 @@
/**
* @type {import("@ianvs/prettier-plugin-sort-imports").PrettierConfig}
* @see https://prettier.io/docs/en/configuration.html
* @type {import("prettier").Config}
*/
module.exports = {
// Standard prettier options
useTabs: true,
printWidth: 100,
singleQuote: true,
trailingComma: 'none',
bracketSameLine: false,
semi: true,
quoteProps: 'consistent',
plugins: ['@ianvs/prettier-plugin-sort-imports', 'prettier-plugin-tailwindcss'],

// prettier-plugin-sort-imports options
// https://github.com/IanVS/prettier-plugin-sort-imports
importOrder: [
// External packages
'<THIRD_PARTY_MODULES>',
// builder.group packages
'^@blgc/',
// Internal packages
'^@/',
'',
// Relative
'^[../]',
'^[./]'
],
importOrderParserPlugins: ['typescript', 'jsx', 'decorators-legacy'],
importOrderTypeScriptVersion: '5.2.2'
...require('@blgc/config/prettier')
};
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The structure of the `package.json` file in this project should adhere to a spec
"scripts": {
"build": "shx rm -rf dist && chmod +x ../../scripts/cli.sh && ../../scripts/cli.sh bundle",
"start:dev": "tsc -w",
"lint": "eslint --ext .js,.ts src/",
"lint": "eslint . --fix",
"clean": "shx rm -rf dist && shx rm -rf node_modules && shx rm -rf .turbo",
"install:clean": "pnpm run clean && pnpm install",
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down
2 changes: 1 addition & 1 deletion examples/feature-fetch/vanilla/open-meteo/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "feature-fetch-vanilla-open-meteo",
"private": true,
"version": "0.0.1",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
1 change: 0 additions & 1 deletion examples/feature-fetch/vanilla/open-meteo/src/api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { createApiFetchClient } from 'feature-fetch';

import { paths } from './gen/v1';

const apiFetchClient = createApiFetchClient({ prefixUrl: 'https://api.open-meteo.com/' });
Expand Down
1 change: 0 additions & 1 deletion examples/feature-fetch/vanilla/open-meteo/src/openapi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { createOpenApiFetchClient } from 'feature-fetch';

import { type paths } from './gen/v1';

const openApiFetchClient = createOpenApiFetchClient<paths>({
Expand Down
2 changes: 1 addition & 1 deletion examples/feature-form/react/basic/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "feature-form-react-basic",
"private": true,
"version": "0.0.1",
"private": true,
"type": "module",
"scripts": {
"dev": "vite"
Expand Down
5 changes: 1 addition & 4 deletions examples/feature-form/react/basic/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { randomHex, shortId } from '@blgc/utils';
import {
bitwiseFlag,
createForm,
Expand All @@ -11,13 +12,9 @@ import { useGlobalState, withGlobalBind } from 'feature-react/state';
import React from 'react';
import * as v from 'valibot';
import * as z from 'zod';
import { randomHex, shortId } from '@blgc/utils';

import './App.css';

import { vValidator } from 'validation-adapters/valibot';
import { zValidator } from 'validation-adapters/zod';

import { StatusMessage } from './components';
import { isLightColor } from './utils';

Expand Down
1 change: 0 additions & 1 deletion examples/feature-form/react/basic/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import ReactDOM from 'react-dom/client';

import App from './App.tsx';

ReactDOM.createRoot(document.getElementById('root')!).render(
Expand Down
2 changes: 1 addition & 1 deletion examples/feature-state/react/counter/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "feature-state-react-counter",
"private": true,
"version": "0.0.1",
"private": true,
"type": "module",
"scripts": {
"dev": "vite"
Expand Down
1 change: 0 additions & 1 deletion examples/feature-state/react/counter/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useGlobalState } from 'feature-react/state';

import { $counter } from './store';

export default function App() {
Expand Down
1 change: 0 additions & 1 deletion examples/feature-state/react/counter/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import ReactDOM from 'react-dom/client';

import App from './App.tsx';

ReactDOM.createRoot(document.getElementById('root')!).render(
Expand Down
7 changes: 0 additions & 7 deletions examples/openapi-router/express/petstore/.eslintrc.js

This file was deleted.

5 changes: 5 additions & 0 deletions examples/openapi-router/express/petstore/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/**
* @see https://eslint.org/docs/latest/use/configure/configuration-files
* @type {import("eslint").Linter.Config}
*/
module.exports = [...require('@blgc/config/eslint/library')];
14 changes: 7 additions & 7 deletions examples/openapi-router/express/petstore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
"name": "openapi-router-express-petstore",
"version": "0.0.1",
"private": true,
"main": "./dist/index.js",
"source": "./src/index.ts",
"files": [
"dist",
"README.md"
],
"scripts": {
"dev": "nodemon --config ./nodemon.json",
"openapi:generate": "npx openapi-typescript ./resources/openapi-v1.yaml -o ./src/gen/v1.ts"
},
"source": "./src/index.ts",
"main": "./dist/index.js",
"dependencies": {
"@blgc/openapi-router": "workspace:*",
"express": "^4.21.1",
Expand All @@ -21,9 +25,5 @@
"nodemon": "^3.1.7",
"openapi-typescript": "^7.4.2",
"ts-node": "^10.9.2"
},
"files": [
"dist",
"README.md"
]
}
}
1 change: 0 additions & 1 deletion examples/openapi-router/express/petstore/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import express from 'express';

import { errorMiddleware, invalidPathMiddleware } from './middlewares';
import { router } from './router';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type express from 'express';
import { AppError } from '@blgc/openapi-router';

import type express from 'express';
import { type components } from '../gen/v1';

export function errorMiddleware(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type express from 'express';
import { AppError } from '@blgc/openapi-router';
import type express from 'express';

export function invalidPathMiddleware(
req: express.Request,
Expand Down
3 changes: 1 addition & 2 deletions examples/openapi-router/express/petstore/src/router.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { createExpressOpenApiRouter } from '@blgc/openapi-router';
import { Router } from 'express';
import * as v from 'valibot';
import { vValidator } from 'validation-adapters/valibot';
import { createExpressOpenApiRouter } from '@blgc/openapi-router';

import { type paths } from './gen/v1';
import { PetSchema } from './schemas';

Expand Down
2 changes: 1 addition & 1 deletion examples/openapi-router/express/petstore/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@blgc/config/shared-library.tsconfig.json",
"extends": "@blgc/config/typescript/node20",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { AppError } from '@blgc/openapi-router';
import type * as hono from 'hono/types';
import { StatusCode } from 'hono/utils/http-status';
import { AppError } from '@blgc/openapi-router';

import { components } from '../gen/v1';

export const errorHandler: hono.ErrorHandler = (err, c) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as hono from 'hono/types';
import { AppError } from '@blgc/openapi-router';
import type * as hono from 'hono/types';

export const invalidPathHandler: hono.NotFoundHandler = (c) => {
throw new AppError('#ERR_PATH_NOT_FOUND', 404, {
Expand Down
1 change: 0 additions & 1 deletion examples/openapi-router/hono/petstore/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { serve } from '@hono/node-server';
import { Hono } from 'hono';

import { errorHandler, invalidPathHandler } from './handlers';
import { router } from './router';

Expand Down
3 changes: 1 addition & 2 deletions examples/openapi-router/hono/petstore/src/router.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { createHonoOpenApiRouter } from '@blgc/openapi-router';
import { Hono } from 'hono';
import { zValidator } from 'validation-adapters/zod';
import * as z from 'zod';
import { createHonoOpenApiRouter } from '@blgc/openapi-router';

import { paths } from './gen/v1';
import { PetSchema } from './schemas';

Expand Down
2 changes: 1 addition & 1 deletion examples/xml-tokenizer/vanilla/playground/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "xml-tokenizer-vanilla-playground",
"private": true,
"version": "0.0.1",
"private": true,
"type": "module",
"scripts": {
"dev": "vite"
Expand Down
61 changes: 27 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,57 +1,50 @@
{
"name": "community",
"description": "Community libraries maintained by builder.group",
"private": true,
"scripts": {
"build": "pnpm build:cli && turbo run build",
"build:cli": "turbo run build --filter=@blgc/cli && pnpm run cli:hello",
"packages:version": "changeset version",
"packages:publish": "changeset publish",
"packages:change": "changeset",
"clean": "turbo run clean && shx rm -rf node_modules",
"install:clean": "pnpm run clean && pnpm install",
"lint": "turbo lint",
"format": "prettier --write \"**/*.{ts,tsx,md,json,js,jsx}\"",
"update:latest": "turbo run update:latest",
"cli:hello": "chmod +x ./scripts/cli.sh && sh ./scripts/cli.sh hello"
"description": "Community libraries maintained by builder.group",
"keywords": [],
"homepage": "https://builder.group/?source=github",
"bugs": {
"url": "https://github.com/builder-group/monorepo/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/builder-group/monorepo.git"
},
"keywords": [],
"author": "@bennobuilder",
"license": "MIT",
"bugs": {
"url": "https://github.com/builder-group/monorepo/issues"
"author": "@bennobuilder",
"scripts": {
"build": "pnpm build:cli && turbo run build",
"build:cli": "turbo run build --filter=@blgc/cli && pnpm run cli:hello",
"clean": "turbo run clean && shx rm -rf node_modules",
"cli:hello": "chmod +x ./scripts/cli.sh && sh ./scripts/cli.sh hello",
"format": "prettier --write \"**/*.{ts,tsx,md,json,js,jsx}\"",
"install:clean": "pnpm run clean && pnpm install",
"lint": "turbo lint",
"packages:change": "changeset",
"packages:publish": "changeset publish",
"packages:version": "changeset version",
"update:latest": "turbo run update:latest"
},
"homepage": "https://builder.group/?source=github",
"devDependencies": {
"@blgc/cli": "workspace:*",
"@blgc/config": "workspace:*",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.9",
"@ianvs/prettier-plugin-sort-imports": "^4.3.1",
"@changesets/cli": "^2.27.10",
"@ianvs/prettier-plugin-sort-imports": "^4.4.0",
"@size-limit/esbuild": "^11.1.6",
"@size-limit/esbuild-why": "^11.1.6",
"@size-limit/preset-small-lib": "^11.1.6",
"eslint": "^8.57.0",
"prettier": "^3.3.3",
"prettier-plugin-tailwindcss": "^0.6.8",
"eslint": "^9.15.0",
"prettier": "^3.4.1",
"prettier-plugin-tailwindcss": "^0.6.9",
"shx": "^0.3.4",
"size-limit": "^11.1.6",
"turbo": "^2.2.3",
"typescript": "^5.6.3",
"vitest": "^2.1.4"
},
"packageManager": "[email protected]",
"pnpm": {
"updateConfig": {
"ignoreDependencies": [
"eslint"
]
}
"turbo": "^2.3.3",
"typescript": "^5.7.2",
"vitest": "^2.1.6"
},
"packageManager": "[email protected]",
"engines": {
"node": ">=20"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/_archived/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Archived packages and code chunks
# Archived packages and code chunks
Loading

0 comments on commit adf6089

Please sign in to comment.