Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
remove biome, update eslint + ts configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kayla Fitzsimmons authored and Kayla Fitzsimmons committed Sep 24, 2024
1 parent eaaa9da commit 0d6ebf9
Show file tree
Hide file tree
Showing 54 changed files with 2,598 additions and 4,630 deletions.
11 changes: 1 addition & 10 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
// This configuration only applies to the package manager root.
/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: ["@repo/eslint-config/library.js"],
extends: ["@repo/config-eslint/base.js"],
ignorePatterns: ["apps/**", "packages/**"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: true,
},
plugins: ["@typescript-eslint"],
root: true,
rules: {
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"no-unused-vars": "off",
},
};
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,7 @@ jobs:
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
- name: Lint
run: pnpm lint
- name: Build artifacts
run: pnpm build
run: pnpm build
3 changes: 3 additions & 0 deletions .prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: "@repo/config-prettier/index.js",
};
41 changes: 0 additions & 41 deletions apps/mocksi-lite-next/.eslintrc

This file was deleted.

3 changes: 3 additions & 0 deletions apps/mocksi-lite-next/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: "@repo/config-eslint/web.js",
};
21 changes: 5 additions & 16 deletions apps/mocksi-lite-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,21 @@
"description": "A simple chrome extension template with Vite, React, TypeScript and Tailwind CSS.",
"devDependencies": {
"@crxjs/vite-plugin": "^2.0.0-beta.23",
"@types/chrome": "^0.0.268",
"@types/node": "^20.12.11",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.0",
"@types/webextension-polyfill": "^0.10.7",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"@repo/config-eslint": "workspace:*",
"@repo/config-prettier": "workspace:*",
"@repo/config-typescript": "workspace:*",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.19",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.2",
"fs-extra": "^11.2.0",
"nodemon": "^3.1.0",
"postcss": "^8.4.38",
"prettier": "^3.2.5",
"tailwindcss": "^3.4.3",
"ts-node": "^10.9.2",
"typescript": "^5.4.5",
"vite": "^5.2.11"
},
"license": "MIT",
"name": "vite-web-extension",
"name": "web-extension",
"repository": {
"type": "git",
"url": "https://github.com/JohnBra/web-extension.git"
Expand All @@ -49,7 +38,7 @@
"build": "vite build --mode '${npm_config_mode}'",
"dev": "nodemon",
"format": "prettier --write \"src/**/*.{tsx,ts}\"",
"lint": "eslint --fix --ext .ts,.tsx"
"lint": "eslint --fix"
},
"type": "module",
"version": "1.2.0"
Expand Down
42 changes: 4 additions & 38 deletions apps/mocksi-lite-next/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,10 @@
{
"compilerOptions": {
"allowJs": false,
"allowSyntheticDefaultImports": true,
"baseUrl": ".",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react-jsx",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"noFallthroughCasesInSwitch": true,
"paths": {
"@assets/*": [
"src/assets/*"
],
"@pages/*": [
"src/pages/*"
],
"@src/*": [
"src/*"
]
},
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"target": "esnext",
"types": [
"vite/client",
"node",
"chrome"
]
},
"extends": "@repo/config-typescript/web-app.json",
"ignore": [
"public"
],
"include": [
"src",
"utils",
"vite.config.ts"
],
}
21 changes: 18 additions & 3 deletions apps/mocksi-lite-next/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
import { ManifestV3Export, crx } from "@crxjs/vite-plugin";
import { type ManifestV3Export, crx } from "@crxjs/vite-plugin";
import react from "@vitejs/plugin-react";
import { resolve } from "path";
import { defineConfig, loadEnv } from "vite";
import manifest from "./manifest.json";
import baseManifest from "./manifest.json";
import pkg from "./package.json";

interface ManifestConfig {
content_security_policy: {
extension_pages: string;
};
externally_connectable: {
matches: string[];
};
key?: string;
name: string;
web_accessible_resources: { matches: string[]; resources: string[] }[];
}

const root = resolve(__dirname, "src");
const pagesDir = resolve(root, "pages");

const assetsDir = resolve(root, "assets");
const outDir = resolve(__dirname, "dist");
const pagesDir = resolve(root, "pages");
const publicDir = resolve(__dirname, "public");

export default defineConfig(({ mode }) => {
Expand All @@ -35,6 +48,8 @@ export default defineConfig(({ mode }) => {
);
}

const manifest: ManifestConfig = baseManifest;

// Dev note: make sure these urls are what you expect them to be for current mode!
manifest.externally_connectable.matches = [`${env.VITE_NEST_APP}/*`];
manifest.content_security_policy.extension_pages = `object-src 'none'; child-src ${env.VITE_NEST_APP}; frame-src ${env.VITE_NEST_APP}; script-src 'self'`;
Expand Down
26 changes: 14 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
{
"name": "harlighter",
"private": true,
"scripts": {
"build": "turbo build",
"dev": "turbo dev"
"dependencies": {
"@repo/reactor": "workspace:*"
},
"devDependencies": {
"@repo/eslint-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"prettier": "^3.2.5",
"turbo": "1.13.3"
"@repo/config-eslint": "workspace:*",
"@repo/config-prettier": "workspace:*",
"@repo/config-typescript": "workspace:*",
"turbo": "latest"
},
"packageManager": "[email protected]",
"engines": {
"node": ">=18"
},
"dependencies": {
"@repo/reactor": "workspace:*"
"name": "harlighter",
"packageManager": "[email protected]",
"private": true,
"scripts": {
"build": "turbo build",
"dev": "turbo dev",
"format": "turbo format",
"lint": "turbo lint"
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# `@turbo/eslint-config`
# `@turbo/config-eslint`

Collection of internal eslint configurations.
30 changes: 15 additions & 15 deletions packages/eslint-config/next.js → packages/config-eslint/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@ const project = resolve(process.cwd(), "tsconfig.json");
module.exports = {
extends: [
"eslint:recommended",
"prettier",
require.resolve("@vercel/style-guide/eslint/next"),
"eslint-config-turbo",
"eslint-config-prettier",
"prettier",
],
ignorePatterns: [
// Ignore dotfiles
".*.js",
"node_modules/",
],
globals: {
React: true,
JSX: true,
overrides: [{ files: ["*.js?(x)", "*.ts?(x)"] }],
parser: "@typescript-eslint/parser",
parserOptions: {
project: true,
},
env: {
node: true,
browser: true,
plugins: ["only-warn", "@typescript-eslint/eslint-plugin"],
rules: {
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"no-unused-vars": "off",
},
plugins: ["only-warn"],
settings: {
"import/resolver": {
typescript: {
project,
},
},
},
ignorePatterns: [
// Ignore dotfiles
".*.js",
"node_modules/",
],
overrides: [{ files: ["*.js?(x)", "*.ts?(x)"] }],
};
17 changes: 17 additions & 0 deletions packages/config-eslint/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"devDependencies": {
"@typescript-eslint/eslint-plugin": "latest",
"@typescript-eslint/parser": "latest",
"eslint": "latest",
"eslint-config-turbo": "^1.13.4",
"eslint-plugin-only-warn": "^1.1.0",
"typescript": "^5.3.3"
},
"files": [
"web.js",
"base.js"
],
"name": "@repo/config-eslint",
"private": true,
"version": "1.0.0"
}
42 changes: 42 additions & 0 deletions packages/config-eslint/web.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
env: {
browser: true,
es6: true,
},

extends: ["./base.js"],
extends: [
"@repo/config-eslint/base.js",
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
],
globals: {
JSX: true,
React: true,
},
globals: {
chrome: "readonly",
},
ignorePatterns: ["nodemon.js", "dist/**"],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["react"],
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
},
],
"no-unused-vars": "off",
"react/react-in-jsx-scope": "off",
},
};
10 changes: 10 additions & 0 deletions packages/config-prettier/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/** @type {import("prettier").Config} */
const config = {
plugins: [
"prettier-plugin-organize-attributes",
"prettier-plugin-tailwindcss",
],
semi: true,
};

module.exports = config;
17 changes: 17 additions & 0 deletions packages/config-prettier/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"devDependencies": {
"prettier": "^3.2.5",
"prettier-plugin-organize-attributes": "latest",
"prettier-plugin-tailwindcss": "^0.5.11"
},
"files": [
"index.js"
],
"license": "MIT",
"name": "@repo/config-prettier",
"private": true,
"publishConfig": {
"access": "public"
},
"version": "1.0.0"
}
Loading

0 comments on commit 0d6ebf9

Please sign in to comment.