Skip to content
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
2 changes: 2 additions & 0 deletions .changeset/quiet-lint-free.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
49 changes: 46 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"shiki-twoslash>@typescript/vfs": "link:./packages/typescript-vfs",
"@types/react": "^18.3.28",
"@types/estree": "0.0.46",
"@types/eslint": "7.29.0",
"assert": "2.0.0",
"rollup-plugin-typescript2": "0.37.0",
"typescript": "6.0.3",
Expand All @@ -43,14 +42,58 @@
"path-to-regexp@0.1.12": "0.1.13",
"lodash@<4.18.1": "^4.18.1",
"immutable@<3.8.4": "^3.8.4",
"dompurify@<3.4.17": "^3.4.17"
"dompurify@<3.4.17": "^3.4.17",
"cookie@<0.7.0": "^0.7.2",
"tmp@<0.2.6": "^0.2.7",
"serialize-javascript@<7.1.3": "^7.1.3",
"uuid@<11.1.1": "^11.1.1",
"resolve-url-loader>postcss": "^8.5.32",
"decode-uri-component@<0.5.1": "^0.5.1",
"file-type@<21.3.1": "^21.3.1",
"@graphql-tools/utils@<12.0.1": "^13.2.1",
"webpack-dev-middleware@<7.4.5": "^7.4.5",
"glob@>=9.0.0 <14.0.2": "^14.0.2",
"minimatch@>=7.0.0 <11.0.1": "^11.0.1",
"gatsby-parcel-config>@parcel/reporter-dev-server": "-",
"node-stdlib-browser>crypto-browserify": "-",
"gatsby>@babel/eslint-parser": "-",
"gatsby>@typescript-eslint/eslint-plugin": "-",
"gatsby>@typescript-eslint/parser": "-",
"gatsby>eslint": "-",
"gatsby>eslint-config-react-app": "-",
"gatsby>eslint-plugin-flowtype": "-",
"gatsby>eslint-plugin-import": "-",
"gatsby>eslint-plugin-jsx-a11y": "-",
"gatsby>eslint-plugin-react": "-",
"gatsby>eslint-plugin-react-hooks": "-",
"gatsby>eslint-webpack-plugin": "-",
"dts-cli>@typescript-eslint/eslint-plugin": "-",
"dts-cli>@typescript-eslint/parser": "-",
"dts-cli>eslint": "-",
"dts-cli>eslint-config-prettier": "-",
"dts-cli>eslint-plugin-flowtype": "-",
"dts-cli>eslint-plugin-import": "-",
"dts-cli>eslint-plugin-jest": "-",
"dts-cli>eslint-plugin-jsx-a11y": "-",
"dts-cli>eslint-plugin-prettier": "-",
"dts-cli>eslint-plugin-react": "-",
"dts-cli>eslint-plugin-react-hooks": "-",
"dts-cli>eslint-plugin-testing-library": "-",
"react-dev-utils>fork-ts-checker-webpack-plugin": "-",
"keyv@<5.5.3": "^5.5.3"
},
"patchedDependencies": {
"@vscode/monaco-lsp-client@0.1.0": "patches/@vscode__monaco-lsp-client@0.1.0.patch",
"gatsby-remark-shiki-twoslash@3.0.38": "patches/gatsby-remark-shiki-twoslash@3.0.38.patch",
"monaco-editor-core@0.56.0": "patches/monaco-editor-core@0.56.0.patch",
"coi-serviceworker@0.1.7": "patches/coi-serviceworker@0.1.7.patch",
"monaco-editor@0.56.0": "patches/monaco-editor@0.56.0.patch"
"monaco-editor@0.56.0": "patches/monaco-editor@0.56.0.patch",
"query-string@6.14.1": "patches/query-string@6.14.1.patch",
"gatsby-core-utils@4.16.0": "patches/gatsby-core-utils@4.16.0.patch",
"gatsby-parcel-config@1.16.0": "patches/gatsby-parcel-config@1.16.0.patch",
"node-stdlib-browser@1.3.1": "patches/node-stdlib-browser@1.3.1.patch",
"gatsby@5.16.1": "patches/gatsby@5.16.1.patch",
"dts-cli@2.0.5": "patches/dts-cli@2.0.5.patch"
},
"ignoredBuiltDependencies": [
"@parcel/watcher",
Expand Down
3 changes: 1 addition & 2 deletions packages/ts-twoslasher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
"build": "dts build && pnpm readme && pnpm make-global",
"make-global": "node scripts/makeGlobals.js",
"readme": "pnpm md-magic README.md --config ./scripts/inline-results.js && pnpm prettier README.md --write",
"test": "dts test",
"lint": "dts lint"
"test": "dts test"
},
"devDependencies": {
"@types/jest": "^30.0.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/typescript-vfs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
"build": "dts build && pnpm make-for-website && pnpm make-global",
"make-for-website": "cpy src/index.ts ../sandbox/src/vendor --flat --rename=typescript-vfs.ts",
"make-global": "node scripts/makeGlobals.js",
"test": "dts test",
"lint": "dts lint"
"test": "dts test"
},
"jest": {
"preset": "ts-jest",
Expand Down
1 change: 1 addition & 0 deletions packages/typescriptlang-org/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ config.onCreateWebpackConfig = ({ loaders, actions, plugins, stage }) => {
tls: false,
child_process: false,
inspector: false,
crypto: false,
jsdom: false,
},
},
Expand Down
5 changes: 1 addition & 4 deletions packages/typescriptlang-org/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,5 @@
},
"bugs": {
"url": "https://github.com//microsoft/TypeScript-Website/issues"
},
"eslintIgnore": [
"*.js"
]
}
}
87 changes: 87 additions & 0 deletions patches/dts-cli@2.0.5.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
diff --git a/dist/index.js b/dist/index.js
index 5585f366c456f9ec9f36263997727cc35a12faaa..461fc5122e17419781d413a35fceca113b6f93d1 100755
--- a/dist/index.js
+++ b/dist/index.js
@@ -11,7 +11,6 @@ const chalk_1 = tslib_1.__importDefault(require("chalk"));
const figlet_1 = tslib_1.__importDefault(require("figlet"));
const fs = tslib_1.__importStar(require("fs-extra"));
const jest = tslib_1.__importStar(require("jest"));
-const eslint_1 = require("eslint");
const logError_1 = tslib_1.__importDefault(require("./logError"));
const path_1 = tslib_1.__importDefault(require("path"));
const execa_1 = tslib_1.__importDefault(require("execa"));
@@ -22,7 +21,6 @@ const constants_1 = require("./constants");
const Messages = tslib_1.__importStar(require("./messages"));
const createBuildConfigs_1 = require("./createBuildConfigs");
const createJestConfig_1 = require("./createJestConfig");
-const createEslintConfig_1 = require("./createEslintConfig");
const utils_1 = require("./utils");
const jpjs_1 = require("jpjs");
const getInstallCmd_1 = tslib_1.__importDefault(require("./getInstallCmd"));
@@ -477,66 +475,6 @@ prog
const [, ...argsToPassToJestCli] = argv;
jest.run(argsToPassToJestCli);
});
-prog
- .command('lint')
- .describe('Run eslint with Prettier')
- .example('lint src test')
- .option('--fix', 'Fixes fixable errors and warnings', false)
- .example('lint src test --fix')
- .option('--ignore-pattern', 'Ignore a pattern')
- .example('lint src test --ignore-pattern test/foobar.ts')
- .option('--max-warnings', 'Exits with non-zero error code if number of warnings exceed this number', Infinity)
- .example('lint src test --max-warnings 10')
- .option('--write-file', 'Write the config file locally')
- .example('lint --write-file')
- .option('--report-file', 'Write JSON report to file locally')
- .example('lint --report-file eslint-report.json')
- .action(async (opts) => {
- if (opts['_'].length === 0 && !opts['write-file']) {
- const defaultInputs = ['src', 'test'].filter(fs.existsSync);
- opts['_'] = defaultInputs;
- console.log(chalk_1.default.yellow(`Defaulting to "dts lint ${defaultInputs.join(' ')}"`, '\nYou can override this in the package.json scripts, like "lint": "dts lint src otherDir"'));
- }
- try {
- const config = await (0, createEslintConfig_1.createEslintConfig)({
- pkg: appPackageJson,
- rootDir: constants_1.paths.appRoot,
- writeFile: opts['write-file'],
- });
- const linter = new eslint_1.ESLint({
- cwd: constants_1.paths.appRoot,
- baseConfig: Object.assign(Object.assign(Object.assign({}, config), appPackageJson.eslint), { ignorePatterns: opts['ignore-pattern'] }),
- extensions: ['.js', '.mjs', '.cjs', '.ts', '.tsx', '.jsx'],
- fix: opts.fix,
- });
- const results = await linter.lintFiles(opts['_']);
- if (opts.fix) {
- await eslint_1.ESLint.outputFixes(results);
- }
- const formatter = await linter.loadFormatter('stylish');
- const jsonFormatter = await linter.loadFormatter('json');
- console.log(formatter.format(results));
- if (opts['report-file']) {
- await fs.outputFile(opts['report-file'], jsonFormatter.format(results));
- }
- let errorCount = 0;
- let warningCount = 0;
- results.forEach((result) => {
- errorCount += result.errorCount;
- warningCount += result.warningCount;
- });
- if (errorCount > 0) {
- process.exit(1);
- }
- if (warningCount > opts['max-warnings']) {
- process.exit(1);
- }
- }
- catch (e) {
- process.exitCode = 1;
- console.error(e);
- }
-});
prog.parse(process.argv);
const defineConfig = (config) => {
return config;
41 changes: 41 additions & 0 deletions patches/gatsby-core-utils@4.16.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
diff --git a/dist/fetch-remote-file.js b/dist/fetch-remote-file.js
index 2653211d2474e1043df96a728652c0bcc2fc6cfe..ba4b3d4e57d678c3df796d6cfd8591effefb5696 100644
--- a/dist/fetch-remote-file.js
+++ b/dist/fetch-remote-file.js
@@ -3,7 +3,7 @@
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.fetchRemoteFile = fetchRemoteFile;
-var _fileType = _interopRequireDefault(require("file-type"));
+var _fileType = require("file-type");
var _path = _interopRequireDefault(require("path"));
var _fsExtra = _interopRequireDefault(require("fs-extra"));
var _fastq = _interopRequireDefault(require("fastq"));
@@ -172,7 +172,7 @@ async function fetchFile({
// If the user did not provide an extension and we couldn't get one from remote file, try and guess one
if (!ext) {
// if this is fresh response - try to guess extension and cache result for future
- const filetype = await _fileType.default.fromFile(tmpFilename);
+ const filetype = await _fileType.fileTypeFromFile(tmpFilename);
if (filetype) {
ext = `.${filetype.ext}`;
filename += ext;
diff --git a/dist/fetch-remote-file.mjs b/dist/fetch-remote-file.mjs
index 06ac6930ecda4e82402f69d329162bf341f6aca4..15facdb8929fd9051cd100d85928762bef1a96c7 100644
--- a/dist/fetch-remote-file.mjs
+++ b/dist/fetch-remote-file.mjs
@@ -1,4 +1,4 @@
-import fileType from "file-type";
+import { fileTypeFromFile } from "file-type";
import path from "path";
import fs from "fs-extra";
import Queue from "fastq";
@@ -167,7 +167,7 @@ async function fetchFile({
// If the user did not provide an extension and we couldn't get one from remote file, try and guess one
if (!ext) {
// if this is fresh response - try to guess extension and cache result for future
- const filetype = await fileType.fromFile(tmpFilename);
+ const filetype = await fileTypeFromFile(tmpFilename);
if (filetype) {
ext = `.${filetype.ext}`;
filename += ext;
12 changes: 12 additions & 0 deletions patches/gatsby-parcel-config@1.16.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/lib/index.json b/lib/index.json
index 2b1adb9f7d5a602eec487cfef18488efe12b0122..49cb7282e3f5b22254f641d338941453fe497df5 100644
--- a/lib/index.json
+++ b/lib/index.json
@@ -19,6 +19,5 @@
"compressors": {
"*": ["@parcel/compressor-raw"]
},
- "resolvers": ["@parcel/resolver-default"],
- "reporters": ["@parcel/reporter-dev-server"]
+ "resolvers": ["@parcel/resolver-default"]
}
73 changes: 73 additions & 0 deletions patches/gatsby@5.16.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
diff --git a/dist/utils/webpack-utils.js b/dist/utils/webpack-utils.js
index 6207bee06f4ee0f006a2381dd3a89d8773a7a270..56b6b172fe2e2f2831994f85c92cf8308e3a2a78 100644
--- a/dist/utils/webpack-utils.js
+++ b/dist/utils/webpack-utils.js
@@ -11,13 +11,11 @@ var _miniCssExtractPlugin = _interopRequireDefault(require("mini-css-extract-plu
var _cssMinimizerWebpackPlugin = _interopRequireDefault(require("css-minimizer-webpack-plugin"));
var _reactRefreshWebpackPlugin = _interopRequireDefault(require("@pmmmwh/react-refresh-webpack-plugin"));
var _browserslist = require("./browserslist");
-var _eslintWebpackPlugin = _interopRequireDefault(require("eslint-webpack-plugin"));
var _gatsbyCoreUtils = require("gatsby-core-utils");
var _gatsbyWebpackStatsExtractor = require("./gatsby-webpack-stats-extractor");
var _getPublicPath = require("./get-public-path");
var _gatsbyWebpackVirtualModules = require("./gatsby-webpack-virtual-modules");
var _webpackPlugins = require("./webpack-plugins");
-var _eslintConfig = require("./eslint-config");
var _redux = require("../redux");
var _constants = require("../constants");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -546,24 +544,6 @@ const createWebpackUtils = (stage, program) => {
// TODO: remove this in v5
plugins.eslintGraphqlSchemaReload = () => null;
plugins.virtualModules = () => new _gatsbyWebpackVirtualModules.GatsbyWebpackVirtualModules();
- plugins.eslint = () => {
- const options = {
- extensions: [`js`, `jsx`],
- exclude: [`/node_modules/`, `/bower_components/`, _gatsbyWebpackVirtualModules.VIRTUAL_MODULES_BASE_PATH],
- ...(0, _eslintConfig.eslintConfig)(config.jsxRuntime === `automatic`)
- };
- // @ts-ignore
- return new _eslintWebpackPlugin.default(options);
- };
- plugins.eslintRequired = () => {
- const options = {
- extensions: [`js`, `jsx`],
- exclude: [`/node_modules/`, `/bower_components/`, _gatsbyWebpackVirtualModules.VIRTUAL_MODULES_BASE_PATH],
- ..._eslintConfig.eslintRequiredConfig
- };
- // @ts-ignore
- return new _eslintWebpackPlugin.default(options);
- };
return {
loaders,
rules,
diff --git a/dist/utils/webpack.config.js b/dist/utils/webpack.config.js
index c6701e66948924d9237e6369c3a9a04734a7f119..cb4777e15d48b29934694050fffebc7214c233e6 100644
--- a/dist/utils/webpack.config.js
+++ b/dist/utils/webpack.config.js
@@ -3,7 +3,6 @@
var _path = require("./path");
var _gatsbyDependents = require("./gatsby-dependents");
var _webpackUtils = require("./webpack-utils");
-var _localEslintConfigFinder = require("./local-eslint-config-finder");
var _gatsbyWebpackVirtualModules = require("./gatsby-webpack-virtual-modules");
var _staticQueryMapper = require("./webpack/plugins/static-query-mapper");
var _forceCssHmrForEdgeCases = require("./webpack/plugins/force-css-hmr-for-edge-cases");
@@ -220,17 +219,6 @@ module.exports = async (program, directory, suppliedStage, port, {
if (process.env.GATSBY_EXPERIMENTAL_DEV_SSR) {
configPlugins.push(plugins.extractStats());
}
- const isCustomEslint = (0, _localEslintConfigFinder.hasLocalEslint)(program.directory);
-
- // if no local eslint config, then add gatsby config
- if (!isCustomEslint) {
- configPlugins.push(plugins.eslint());
- }
-
- // Enforce fast-refresh rules even with local eslint config
- if (isCustomEslint) {
- configPlugins.push(plugins.eslintRequired());
- }
break;
}
case `build-javascript`:
26 changes: 26 additions & 0 deletions patches/node-stdlib-browser@1.3.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/cjs/index.js b/cjs/index.js
index 4f8c41040f5406f6204a8fc6fc6cbde5ab303038..305de0515537a7adfab417ba1decfda68cc90d68 100644
--- a/cjs/index.js
+++ b/cjs/index.js
@@ -53,7 +53,7 @@ const child_process = resolvePath('./mock/empty.js');
const cluster = resolvePath('./mock/empty.js');
const _console = resolvePath('console-browserify');
const constants = resolvePath('constants-browserify');
-const crypto = resolvePath('crypto-browserify');
+const crypto = null;
const dgram = resolvePath('./mock/empty.js');
const dns = resolvePath('./mock/empty.js');
const domain = resolvePath('domain-browser');
diff --git a/esm/index.js b/esm/index.js
index 744e1f0ec2350dae8b2f4c3e470608e5bee6f565..9d7c34b9806d48bd242e4a2d1f8efdd6b07c3f65 100644
--- a/esm/index.js
+++ b/esm/index.js
@@ -46,7 +46,7 @@ const child_process = resolvePath('./mock/empty.js');
const cluster = resolvePath('./mock/empty.js');
const _console = resolvePath('console-browserify');
const constants = resolvePath('constants-browserify');
-const crypto = resolvePath('crypto-browserify');
+const crypto = null;
const dgram = resolvePath('./mock/empty.js');
const dns = resolvePath('./mock/empty.js');
const domain = resolvePath('domain-browser');
12 changes: 12 additions & 0 deletions patches/query-string@6.14.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/index.js b/index.js
index 423b9d6bce4dddc076b7a5f21c6076f9a07b577d..b0429bf70d50734f9763b1fec480c025c97b0c38 100644
--- a/index.js
+++ b/index.js
@@ -1,6 +1,6 @@
'use strict';
const strictUriEncode = require('strict-uri-encode');
-const decodeComponent = require('decode-uri-component');
+const decodeComponent = require('decode-uri-component').default;
const splitOnFirst = require('split-on-first');
const filterObject = require('filter-obj');

Loading
Loading