Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependencies + turborepo fixes #340

Merged
merged 5 commits into from
Jan 1, 2025
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
link-workspace-packages=false
disallow-workspace-cycles=true
3 changes: 1 addition & 2 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"singleQuote": true,
"endOfLine": "auto"
"singleQuote": true
}
2 changes: 1 addition & 1 deletion apps/docs-website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"serve": "docusaurus serve --dir=./dist",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc --noEmit",
"typecheck": "tsc",
"lint": "eslint --max-warnings=0 --flag unstable_ts_config",
"typesync": "typesync --dry=fail",
"clean": "pnpm clear && rm -rf .turbo dist node_modules/.cache"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}

.nativeCheckbox label:before {
content: "";
content: '';
-webkit-appearance: none;
background-color: transparent;
border: 2px solid var(--ifm-toc-border-color);
Expand All @@ -45,7 +45,7 @@
}

.nativeCheckbox input:checked + label:after {
content: "";
content: '';
display: block;
position: absolute;
top: 3px;
Expand Down
10 changes: 5 additions & 5 deletions apps/docs-website/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
} */

/* For readability concerns, you should choose a lighter palette in dark mode. */
[data-theme="dark"] {
[data-theme='dark'] {
--ifm-color-primary: #39e3dd;
--ifm-color-primary-dark: #20dfd9;
--ifm-color-primary-darker: #1ed3cd;
Expand Down Expand Up @@ -59,20 +59,20 @@
}

.navbar-github-link:before {
content: "";
content: '';
width: 24px;
height: 24px;
display: flex;
background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E")
no-repeat;
}

html[data-theme="dark"] .navbar-github-link:before {
html[data-theme='dark'] .navbar-github-link:before {
background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='white' d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E")
no-repeat;
}

[data-theme="light"] .DocSearch {
[data-theme='light'] .DocSearch {
/* --docsearch-primary-color: var(--ifm-color-primary); */
/* --docsearch-text-color: var(--ifm-font-color-base); */
--docsearch-muted-color: var(--ifm-color-secondary-darkest);
Expand All @@ -90,7 +90,7 @@ html[data-theme="dark"] .navbar-github-link:before {
--docsearch-footer-background: var(--ifm-color-white);
}

[data-theme="dark"] .DocSearch {
[data-theme='dark'] .DocSearch {
--docsearch-text-color: var(--ifm-font-color-base);
--docsearch-muted-color: var(--ifm-color-secondary-darkest);
--docsearch-container-background: rgba(47, 55, 69, 0.7);
Expand Down
6 changes: 3 additions & 3 deletions apps/docs-website/src/utils/filterDuplicatedRules.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isEqual } from "lodash-es";
import type { Entry } from "@sherifforg/types";
import { removeElementFromArrayByValue } from "./removeElementFromArrayByValue";
import { isEqual } from 'lodash-es';
import type { Entry } from '@sherifforg/types';
import { removeElementFromArrayByValue } from './removeElementFromArrayByValue';

const isSameItem = (firstOccurrence: Entry, secondOccurrence: Entry) => {
return (
Expand Down
4 changes: 2 additions & 2 deletions apps/sheriff-webservices/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"start": "tsx watch ./src/index.ts",
"build": "tsc",
"typecheck": "tsc --noEmit",
"typecheck": "tsc",
"lint": "eslint --max-warnings=0 --flag unstable_ts_config",
"typesync": "typesync --dry=fail",
"serve": "node ./dist/index.js",
Expand All @@ -26,7 +26,7 @@
"dependencies": {
"@eslint-react/eslint-plugin": "^1.10.1",
"@eslint/js": "^9.17.0",
"@hono/node-server": "^1.12.0",
"@hono/node-server": "~1.7.0",
"@next/eslint-plugin-next": "^13.2.3",
"@regru/eslint-plugin-prefer-early-return": "^1.0.0",
"@stylistic/eslint-plugin": "^2.6.4",
Expand Down
6 changes: 3 additions & 3 deletions apps/sheriff-webservices/src/prependRulesWithPluginName.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { ESLint } from "eslint";
import type { RuleOptions } from "@sherifforg/types";
import type { ESLint } from 'eslint';
import type { RuleOptions } from '@sherifforg/types';

export const prependRulesWithPluginName = (
rules: Record<string, RuleOptions> | ESLint.Plugin["rules"] | undefined,
rules: Record<string, RuleOptions> | ESLint.Plugin['rules'] | undefined,
pluginName: string,
): Record<string, RuleOptions> => {
if (!rules) {
Expand Down
23 changes: 15 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
"name": "sheriff-monorepo",
"private": true,
"scripts": {
"dev": "turbo watch build-watch start",
"dev": "turbo watch eslint-config-sheriff#build @sherifforg/create-config#build start",
"dev:norebuild": "turbo start",
"build": "turbo run build",
"playground": "pnpm --filter=cli-playground exec create-config",
"playground:mimic-monorepo": "pnpm exec create-config --filter=cli-playground",
"playground:cli-checks": "pnpm --filter=cli-playground exec sheriff",
"webservices:deploy": "turbo run serve --filter=sheriff-webservices",
"preview-docs": "turbo run serve --filter=docs-website",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"format": "prettier . --write --cache --cache-location='node_modules/.cache/.prettiercache' --log-level=warn",
"format:check": "prettier . --check --cache --cache-location='node_modules/.cache/.prettiercache'",
"lint": "turbo run lint",
"publint": "turbo run publint --concurrency=1",
"are-the-types-wrong": "turbo run are-the-types-wrong",
Expand All @@ -19,7 +20,7 @@
"typecheck": "turbo run typecheck",
"knip": "knip",
"validate-config": "turbo run validate-config",
"merge-checks": "pnpm build && turbo run publint manypkg typesync knip typecheck lint validate-config are-the-types-wrong && turbo run check-deduped-deps",
"merge-checks": "pnpm build && turbo run publint manypkg typesync knip typecheck lint format:check validate-config are-the-types-wrong && turbo run check-deduped-deps",
"check-deduped-deps": "pnpm dedupe --check",
"clean": "turbo run clean && rm -rf .turbo",
"delete-node-modules": "pnpm exec rm -rf node_modules && pnpm -r exec rm -rf node_modules",
Expand All @@ -40,18 +41,24 @@
"turbo": "^2.2.3",
"typesync": "0.13.0"
},
"packageManager": "pnpm@9.15.1",
"packageManager": "pnpm@9.15.2",
"engines": {
"node": ">=20.10.0"
},
"pnpm": {
"peerDependencyRules": {
"allowAny": [
"typescript"
],
"allowedVersions": {
"eslint": "^9.0.0",
"typescript": "^5.0.0"
},
"ignoreMissing": [
"vitest"
]
}
},
"onlyBuiltDependencies": [
"@swc/core",
"esbuild",
"sharp"
]
}
}
2 changes: 1 addition & 1 deletion packages/eslint-config-sheriff/eslint.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sheriff, type SheriffSettings } from 'eslint-config-sheriff';
import { defineFlatConfig } from 'eslint-define-config';
import { sheriff, type SheriffSettings } from './src';

const sheriffOptions: SheriffSettings = {
react: false,
Expand Down
3 changes: 1 addition & 2 deletions packages/eslint-config-sheriff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@
"re-bundle-types": "dts-bundle-generator --config dts-config.json",
"are-the-types-wrong": "attw --pack --profile=esm-only",
"build": "tsup && pnpm re-bundle-types",
"build-watch": "tsup && pnpm re-bundle-types",
"typecheck": "tsc --noEmit",
"typecheck": "tsc",
"lint": "eslint src --max-warnings=0 --flag unstable_ts_config",
"publint": "publint",
"typesync": "typesync --dry=fail"
Expand Down
11 changes: 5 additions & 6 deletions packages/eslint-config-sheriff/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable import/no-default-export */
/* eslint-disable unicorn/prefer-export-from */

import {
allJsExtensions,
Expand All @@ -9,7 +8,6 @@ import {
supportedFileTypes,
testsFilePatterns,
} from '@sherifforg/constants';
import { getExportableConfig } from './getExportableConfig';
import { getIndexedBaseNoRestrictedSyntaxRules } from './utils/getIndexedBaseNoRestrictedSyntaxRules';

//#region - these '@sherifforg/constants' variables needs to be re-stored like this, otherwise they will not be bundled. They need to be bundled because we are not publishing the 'sheriff-constants' package, but we are using it as a dependency in this package.
Expand All @@ -22,19 +20,20 @@ const exportableTestsFilePatterns = testsFilePatterns;

const indexedBaseNoRestrictedSyntaxRules =
getIndexedBaseNoRestrictedSyntaxRules();
//#endregion

export {
exportableAllJsExtensions as allJsExtensions,
exportableAllJsxExtensions as allJsxExtensions,
indexedBaseNoRestrictedSyntaxRules as baseNoRestrictedSyntaxRules,
exportableIgnores as ignores,
getExportableConfig as sheriff,
exportableSheriffStartingOptions as sheriffStartingOptions,
exportableSupportedFileTypes as supportedFileTypes,
exportableTestsFilePatterns as testsFilePatterns,
};
//#endregion

export {
getExportableConfig as default,
getExportableConfig as sheriff,
} from './getExportableConfig';
export type * from '@sherifforg/types';

export default getExportableConfig;
2 changes: 1 addition & 1 deletion packages/sheriff-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"clean": "rm -rf .turbo dist node_modules/.cache",
"build": "tsup",
"typecheck": "tsc --noEmit",
"typecheck": "tsc",
"lint": "eslint ./src --max-warnings=0",
"publint": "publint",
"typesync": "typesync --dry=fail"
Expand Down
3 changes: 1 addition & 2 deletions packages/sheriff-create-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"dev": "tsx ./src/index.ts",
"clean": "rm -rf .turbo dist node_modules/.cache",
"build": "tsup",
"build-watch": "tsup",
"typecheck": "tsc --noEmit",
"typecheck": "tsc",
"lint": "eslint ./src --max-warnings=0 --flag unstable_ts_config",
"publint": "publint",
"typesync": "typesync --dry=fail"
Expand Down
2 changes: 1 addition & 1 deletion packages/sheriff-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"scripts": {
"clean": "rm -rf .turbo dist node_modules/.cache",
"typecheck": "tsc --noEmit"
"typecheck": "tsc"
},
"devDependencies": {
"@types/node": "^22.9.0",
Expand Down
1 change: 1 addition & 0 deletions packages/tsconfig/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"${configDir}/node_modules"
],
"compilerOptions": {
"noEmit": true,
"composite": false,
"target": "ESNext",
"module": "Preserve",
Expand Down
Loading
Loading