-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b7209c7
commit 1ad3e10
Showing
14 changed files
with
531 additions
and
2,495 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,13 @@ | |
"devDependencies": { | ||
"@changesets/cli": "^2.27.1", | ||
"prettier": "^3.2.5", | ||
"turbo": "^2.0.3" | ||
"turbo": "^2.0.3", | ||
"typescript": "^5.5.4", | ||
"jiti": "^2.4.2" | ||
}, | ||
"packageManager": "[email protected]", | ||
"engines": { | ||
"node": ">=18" | ||
}, | ||
"packageManager": "[email protected]", | ||
"name": "content-builder-design-system" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# `@repo/config-eslint` | ||
|
||
Collection of internal eslint configurations. | ||
|
||
## Structure | ||
|
||
This package contains various ESLint configurations used throughout the monorepo. Below is an explanation of each file and its purpose: | ||
|
||
### Files | ||
|
||
- [`base.ts`](./base.ts): Contains the base ESLint configuration that includes recommended settings for JavaScript and TypeScript. | ||
|
||
- [`next.ts`](./next.ts): Extends the base configuration with additional rules and plugins for Next.js projects. | ||
|
||
- [`react-internal.ts`](./react-internal.ts): Extends the base configuration with additional rules and plugins for React projects, including hooks and JSX settings. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import js from "@eslint/js"; | ||
import type { Linter } from "eslint"; | ||
import turbo from "eslint-plugin-turbo"; | ||
import tseslint from "typescript-eslint"; | ||
|
||
// ? https://github.com/bfanger/eslint-plugin-only-warn/issues/13 | ||
import "eslint-plugin-only-warn"; | ||
|
||
const config = [ | ||
js.configs.recommended, | ||
...tseslint.configs.recommended, | ||
turbo.configs["flat/recommended"], | ||
] as Linter.Config[]; | ||
|
||
export default config; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import eslintConfigPrettier from "eslint-config-prettier"; | ||
import reactPlugin from "eslint-plugin-react"; | ||
import globals from "globals"; | ||
import baseConfig from "./base"; | ||
|
||
// @ts-ignore | ||
import hooksPlugin from "eslint-plugin-react-hooks"; | ||
// @ts-ignore | ||
import pluginNext from "@next/eslint-plugin-next"; | ||
|
||
const nextJsConfig = [ | ||
...baseConfig, | ||
{ | ||
plugins: { | ||
"@next/next": pluginNext, | ||
}, | ||
rules: { | ||
...pluginNext.configs.recommended.rules, | ||
...pluginNext.configs["core-web-vitals"].rules, | ||
}, | ||
}, | ||
{ | ||
files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"], | ||
...reactPlugin.configs.flat?.recommended, | ||
languageOptions: { | ||
...reactPlugin.configs.flat?.recommended?.languageOptions, | ||
globals: { | ||
...globals.serviceworker, | ||
...globals.browser, | ||
}, | ||
}, | ||
rules: { | ||
"react/react-in-jsx-scope": "off", | ||
}, | ||
}, | ||
{ | ||
plugins: { | ||
"react-hooks": hooksPlugin, | ||
}, | ||
rules: hooksPlugin.configs.recommended.rules, | ||
}, | ||
eslintConfigPrettier, | ||
{ | ||
ignores: ["./dist", "node_modules", ".next/*"], | ||
}, | ||
]; | ||
|
||
export default nextJsConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,29 @@ | ||
{ | ||
"name": "@repo/config-eslint", | ||
"version": "0.0.0", | ||
"type": "module", | ||
"private": true, | ||
"files": [ | ||
"library.js", | ||
"react.js", | ||
"storybook.js" | ||
], | ||
"exports": { | ||
"./base": "./base.ts", | ||
"./next-js": "./next.ts", | ||
"./react-internal": "./react-internal.ts", | ||
"./storybook": "./storybook.ts" | ||
}, | ||
"devDependencies": { | ||
"@vercel/style-guide": "^5.2.0", | ||
"eslint-config-turbo": "^2.0.0", | ||
"eslint-plugin-mdx": "^3.1.5", | ||
"@eslint/js": "^9.17.0", | ||
"@next/eslint-plugin-next": "^15.1.0", | ||
"@types/eslint-config-prettier": "^6.11.3", | ||
"@typescript-eslint/eslint-plugin": "^8.15.0", | ||
"@typescript-eslint/parser": "^8.15.0", | ||
"eslint": "^9.15.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-only-warn": "^1.1.0", | ||
"eslint-plugin-storybook": "^0.8.0" | ||
"eslint-plugin-storybook": "^0.11.2", | ||
"eslint-plugin-react": "^7.37.2", | ||
"eslint-plugin-react-hooks": "^5.0.0", | ||
"eslint-plugin-turbo": "^2.3.0", | ||
"globals": "^15.12.0", | ||
"typescript": "^5.3.3", | ||
"typescript-eslint": "^8.15.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import eslintConfigPrettier from "eslint-config-prettier"; | ||
import reactPlugin from "eslint-plugin-react"; | ||
import globals from "globals"; | ||
import baseConfig from "./base.ts"; | ||
|
||
// @ts-ignore | ||
import hooksPlugin from "eslint-plugin-react-hooks"; | ||
|
||
// ? https://github.com/jsx-eslint/eslint-plugin-react?tab=readme-ov-file#configuring-shared-settings | ||
// ? https://github.com/facebook/react/issues/28313 | ||
const config = [ | ||
...baseConfig, | ||
{ | ||
files: ["src/components/**/*.{ts,tsx}"], | ||
...reactPlugin.configs.flat?.recommended, | ||
languageOptions: { | ||
...reactPlugin.configs.flat?.recommended.languageOptions, | ||
globals: { | ||
...globals.serviceworker, | ||
...globals.browser, | ||
}, | ||
}, | ||
rules: { | ||
"react/react-in-jsx-scope": "off", | ||
}, | ||
}, | ||
{ | ||
plugins: { | ||
"react-hooks": hooksPlugin, | ||
}, | ||
rules: hooksPlugin.configs.recommended.rules, | ||
}, | ||
eslintConfigPrettier, | ||
]; | ||
|
||
export default config; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import eslintConfigPrettier from "eslint-config-prettier"; | ||
import reactPlugin from "eslint-plugin-react"; | ||
import storybook from "eslint-plugin-storybook"; | ||
import globals from "globals"; | ||
import baseConfig from "./base.ts"; | ||
const config = [ | ||
...baseConfig, | ||
{ | ||
files: ["src/stories/**/*.{ts,tsx}"], | ||
...reactPlugin.configs.flat?.recommended, | ||
languageOptions: { | ||
...reactPlugin.configs.flat?.recommended.languageOptions, | ||
globals: { | ||
...globals.serviceworker, | ||
...globals.browser, | ||
}, | ||
}, | ||
rules: { | ||
"react/react-in-jsx-scope": "off", | ||
}, | ||
}, | ||
...storybook.configs["flat/recommended"], | ||
eslintConfigPrettier, | ||
{ | ||
ignores: ["!.storybook"], | ||
}, | ||
]; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ESNext", | ||
"module": "ESNext", | ||
"moduleResolution": "Node", | ||
"strict": true, | ||
"esModuleInterop": true, | ||
"skipLibCheck": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"declaration": true, | ||
"emitDeclarationOnly": true, | ||
"allowImportingTsExtensions": true, | ||
"allowJs": true, | ||
"jsx": "react-jsx", | ||
"baseUrl": ".", | ||
"paths": { | ||
"@/*": ["./app/*"] | ||
} | ||
}, | ||
"include": ["**/*.ts"], | ||
"exclude": ["node_modules"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.