Skip to content

Commit

Permalink
Stash: More workspace config work
Browse files Browse the repository at this point in the history
  • Loading branch information
spautz committed Nov 26, 2024
1 parent cc58699 commit 7b29eac
Show file tree
Hide file tree
Showing 7 changed files with 288 additions and 269 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ playwright-report/
.cache-loader/
.docusaurus/
.next/
.react-router/
.turbo/
_fresh/
build/
Expand Down
12 changes: 11 additions & 1 deletion docs-website/blog/tags.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
example-tag:
label: example
permalink: /example
description: Example Tag
description: A tag for demoing tags

package-workspace:
label: package-workspace
permalink: /package-workspace
description: The package workspace setup for this package-template repo

philosophy:
label: philosophy
permalink: /philosophy
description: Philosophy behind design and engineering decisions
69 changes: 68 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1,68 @@
export default from '@spautz/local-dev-configs';
import { fixupPluginRules } from '@eslint/compat';
import eslintJs from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import eslintConfigReactApp from 'eslint-config-react-app';
import eslintPluginFlowtype from 'eslint-plugin-flowtype';
import eslintPluginImport from 'eslint-plugin-import';
import eslintPluginJsxA11y from 'eslint-plugin-jsx-a11y';
import reactRecommended from 'eslint-plugin-react/configs/recommended.js';
import eslintPluginReactHooks from 'eslint-plugin-react-hooks';
import typescriptEslint from 'typescript-eslint';

const buildOutputs = [
'.docusaurus',
'build',
'coverage',
'dist',
'legacy-types',
'node_modules',
'storybook-static',
];
const projectDirectoriesToIgnore = `{${buildOutputs.join(',')}}/**`;

const eslintConfig = [
{
ignores: [
projectDirectoriesToIgnore,
`demos/*/${projectDirectoriesToIgnore}`,
`docs-website/${projectDirectoriesToIgnore}`,
`packages/*/${projectDirectoriesToIgnore}`,
// Each external-test has its own eslint config, following the conventions of its framework, so they're not included
'external-tests/*/**',
],
},
{
plugins: {
// These plugins are all needed for eslint-config-react-app
flowtype: fixupPluginRules(eslintPluginFlowtype),
'jsx-a11y': eslintPluginJsxA11y,
import: fixupPluginRules(eslintPluginImport),
'react-hooks': eslintPluginReactHooks,
},
linterOptions: {
reportUnusedDisableDirectives: true,
},
settings: {
react: {
version: 'detect',
},
},
},

eslintJs.configs.recommended,
eslintConfigPrettier,
reactRecommended,
...typescriptEslint.configs.recommended,

// Overrides:
{
files: ['**/*.{js,ts,jsx,tsx,cjs,mjs}'],
rules: {
...eslintConfigReactApp.rules,
...eslintConfigReactApp.overrides[0].rules,
'react/react-in-jsx-scope': 'off',
},
},
];

export default eslintConfig;
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
"all": "turbo run format && turbo run w:pipeline-all",
"all:ci": "turbo run format:verify w:pipeline-ci",
"all:all": "turbo run format && turbo run pipeline-all w:pipeline-all",
"lint": "turbo run w:lint",
"_lint": "turbo run w:lint",
"lint": "eslint . --max-warnings 0",
"lint:fix": "turbo run w:lint:fix",
"test": "turbo run w:test",
"test:watch": "turbo run w:test:watch",
Expand Down Expand Up @@ -102,10 +103,10 @@
"yargs": "17.7.2"
},
"lint-staged": {
"*.{css,html,js,jsx,json,less,md,scss,ts,tsx,yaml}": [
"*.{cjs,cts,css,html,js,jsx,json,less,md,mjs,mts,scss,ts,tsx,yaml}": [
"prettier --write"
],
"*.{js,jsx,ts,tsx}": [
"*.{cjs,cts,js,jsx,mjs,mts,ts,tsx}": [
"eslint --max-warnings 0 --no-warn-ignored"
]
}
Expand Down
68 changes: 0 additions & 68 deletions packages/local-dev-configs/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,68 +0,0 @@
import { fixupPluginRules } from '@eslint/compat';
import eslintJs from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import eslintConfigReactApp from 'eslint-config-react-app';
import eslintPluginFlowtype from 'eslint-plugin-flowtype';
import eslintPluginImport from 'eslint-plugin-import';
import eslintPluginJsxA11y from 'eslint-plugin-jsx-a11y';
import reactRecommended from 'eslint-plugin-react/configs/recommended.js';
import eslintPluginReactHooks from 'eslint-plugin-react-hooks';
import typescriptEslint from 'typescript-eslint';

const buildOutputs = [
'.docusaurus',
'build',
'coverage',
'dist',
'legacy-types',
'node_modules',
'storybook-static',
];
const projectDirectoriesToIgnore = `{${buildOutputs.join(',')}}/**`;

const eslintConfig = [
{
ignores: [
projectDirectoriesToIgnore,
`demos/*/${projectDirectoriesToIgnore}`,
`docs-website/${projectDirectoriesToIgnore}`,
`packages/*/${projectDirectoriesToIgnore}`,
// Each external-test has its own eslint config, following the conventions of its framework, so they're not included
'external-tests/*/**',
],
},
{
plugins: {
// These plugins are all needed for eslint-config-react-app
flowtype: fixupPluginRules(eslintPluginFlowtype),
'jsx-a11y': eslintPluginJsxA11y,
import: fixupPluginRules(eslintPluginImport),
'react-hooks': eslintPluginReactHooks,
},
linterOptions: {
reportUnusedDisableDirectives: true,
},
settings: {
react: {
version: 'detect',
},
},
},

eslintJs.configs.recommended,
eslintConfigPrettier,
reactRecommended,
...typescriptEslint.configs.recommended,

// Overrides:
{
files: ['**/*.{js,ts,jsx,tsx,cjs,mjs}'],
rules: {
...eslintConfigReactApp.rules,
...eslintConfigReactApp.overrides[0].rules,
'react/react-in-jsx-scope': 'off',
},
},
];

export default eslintConfig;
Loading

0 comments on commit 7b29eac

Please sign in to comment.