diff --git "a/fim_react.jsonl" "b/fim_react.jsonl" new file mode 100644--- /dev/null +++ "b/fim_react.jsonl" @@ -0,0 +1,1806 @@ +{"prefix": "ules: {\n 'ft-flow/array-style-complex-type': [OFF, 'verbose'],\n 'ft-flow/array-style-simple-type': [OFF, 'verbose'], // TODO should be WARNING\n 'ft-flow/boolean-style': ERROR,\n 'ft-flow/no-dupe-keys': ERROR,\n 'ft-flow/no-primitive-constructor-types': ERROR,\n 'ft-flow/no-types-missing-file-annotation': OFF, // TODO should be ERROR\n 'ft-flow/no-unused-expressions': ERROR,\n // 'ft-flow/no-weak-types': WARNING,\n // 'ft-flow/require-valid-file-annotation': ERROR,\n 'es/no-optional-ch", "suffix": "mpty-character-class': WARNING,\n 'no-empty': OFF,\n 'no-ex-assign': WARNING,\n 'no-extra-boolean-cast': WARNING,\n 'no-func-assign': ERROR,\n 'no-invalid-regexp': WARNING,\n 'no-irregular-whitespace': WARNING,\n 'no-negated-in-lhs': ERROR,\n ", "middle": "aining': ERROR,\n 'no-cond-assign': OFF,\n 'no-constant-condition': OFF,\n 'no-control-regex': OFF,\n 'no-debugger': ERROR,\n 'no-dupe-args': ERROR,\n 'no-dupe-keys': ERROR,\n 'no-duplicate-case': WARNING,\n 'no-e", "meta": {"filepath": ".eslintrc.js", "language": "javascript", "file_size": 21080, "cut_index": 1331, "middle_length": 229}} +{"prefix": "ax-jsx',\n '@babel/plugin-transform-flow-strip-types',\n ['@babel/plugin-proposal-class-properties', {loose: true}],\n 'syntax-trailing-function-commas',\n [\n '@babel/plugin-proposal-object-rest-spread',\n {loose: true, useBuiltIns: true},\n ],\n ['@babel/plugin-transform-template-literals', {loose: true}],\n '@babel/plugin-transform-literals',\n '@babel/plugin-transform-arrow-functions',\n '@babel/plugin-transform-block-scoped-functions',\n '@babel/plugin-transform-object-super", "suffix": "',\n '@babel/plugin-transform-for-of',\n ['@babel/plugin-transform-spread', {loose: true, useBuiltIns: true}],\n '@babel/plugin-transform-parameters',\n ['@babel/plugin-transform-destructuring', {loose: true, useBuiltIns: true}],\n ['@babel/plugi", "middle": "',\n '@babel/plugin-transform-shorthand-properties", "meta": {"filepath": "babel.config.js", "language": "javascript", "file_size": 959, "cut_index": 582, "middle_length": 52}} +{"prefix": "d,\n debug(...data: Array): void,\n dir(...data: Array): void,\n dirxml(...data: Array): void,\n error(...data: Array): void,\n _exception(...data: Array): void,\n group(...data: Array): void,\n groupCollapsed(...data: Array): void,\n groupEnd(): void,\n info(...data: Array): void,\n log(...data: Array): void,\n profile(name?: string): void,\n profileEnd(name?: string): void,\n table(\n tabularData:\n | {[key: string]: any, ...}\n | Array<{[key: string]", "suffix": " trackGroup?: string,\n color?: string,\n ): void,\n timeLog(label?: string, ...data?: Array): void,\n trace(...data: Array): void,\n warn(...data: Array): void,\n createTask(label: string): ConsoleTask,\n ...\n};\n\ntype ScrollTimelineOption", "middle": ": any, ...}>\n | Array>,\n ): void,\n time(label?: string): void,\n timeEnd(label: string): void,\n timeStamp(\n label?: string,\n start?: string | number,\n end?: string | number,\n trackName?: string,\n ", "meta": {"filepath": "scripts/flow/environment.js", "language": "javascript", "file_size": 18883, "cut_index": 1331, "middle_length": 229}} +{"prefix": " MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';\n\n// Based on similar script in Jest\n// https://github.com/facebook/jest/blob/a7acc5ae519613647ff2c253dd21933d6f94b47f/scripts/prettier.js\n\nconst chalk = require('chalk');\nconst glob = require('glob');\nconst prettier = require('prettier');\nconst fs = require('fs');\nconst path = require('path');\nconst listChangedFiles = require('../shared/listChangedFiles');\nconst prettierConfigPath = require.resolve('../../", "suffix": "d ? listChangedFiles() : null;\n\nconst prettierIgnoreFilePath = path.join(\n __dirname,\n '..',\n '..',\n '.prettierignore'\n);\nconst prettierIgnore = fs.readFileSync(prettierIgnoreFilePath, {\n encoding: 'utf8',\n});\nconst ignoredPathsListedInPrettierIgnore ", "middle": ".prettierrc');\n\nconst mode = process.argv[2] || 'check';\nconst shouldWrite = mode === 'write' || mode === 'write-changed';\nconst onlyChanged = mode === 'check-changed' || mode === 'write-changed';\n\nconst changedFiles = onlyChange", "meta": {"filepath": "scripts/prettier/index.js", "language": "javascript", "file_size": 3417, "cut_index": 614, "middle_length": 229}} +{"prefix": " MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @emails react-core\n */\n\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst existingErrorMap = JSON.parse(\n fs.readFileSync(path.resolve(__dirname, '../error-codes/codes.json'))\n);\nconst messages = new Set();\nObject.keys(existingErrorMap).forEach(key =>\n messages.add(existingErrorMap[key])\n);\n\n/**\n * The warning() function takes format strings as its second\n * argument.\n */\n\nmodule.exports =", "suffix": ") {\n return node.value;\n } else if (node.type === 'BinaryExpression' && node.operator === '+') {\n const l = getLiteralString(node.left);\n const r = getLiteralString(node.right);\n if (l !== null && r !== null) {\n re", "middle": " {\n meta: {\n schema: [],\n },\n create(context) {\n // we also allow literal strings and concatenated literal strings\n function getLiteralString(node) {\n if (node.type === 'Literal' && typeof node.value === 'string'", "meta": {"filepath": "scripts/eslint-rules/warning-args.js", "language": "javascript", "file_size": 3213, "cut_index": 614, "middle_length": 229}} +{"prefix": "iates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nconst minimatch = require('minimatch');\nconst {ESLint} = require('eslint');\nconst listChangedFiles = require('../shared/listChangedFiles');\n\nconst allPaths = ['**/*.js'];\n\nlet changedFiles = null;\n\nasync function runESLintOnFilesWithOptions(filePatterns, onlyChanged, options) {\n const eslint = new ESLint(options);\n const formatter = await eslint.loadFo", "suffix": "erns;\n const results = await eslint.lintFiles(finalFilePatterns);\n\n if (options != null && options.fix === true) {\n await ESLint.outputFixes(results);\n }\n\n // When using `ignorePattern`, eslint will show `File ignored...` warnings for any ignores.\n ", "middle": "rmatter();\n\n if (onlyChanged && changedFiles === null) {\n // Calculate lazily.\n changedFiles = [...listChangedFiles()];\n }\n const finalFilePatterns = onlyChanged\n ? intersect(changedFiles, filePatterns)\n : filePatt", "meta": {"filepath": "scripts/eslint/index.js", "language": "javascript", "file_size": 2808, "cut_index": 563, "middle_length": 229}} +{"prefix": "poRoot} = require('./utils');\n\nasync function fetchNpmInfo(packageName, {log}) {\n const npmArgs = ['view', `${packageName}@latest`, '--json'];\n const options = {cwd: repoRoot, maxBuffer: 10 * 1024 * 1024};\n log(`Fetching npm info for ${packageName}...`);\n const {stdout} = await execFileAsync('npm', npmArgs, options);\n\n let data = stdout.trim();\n if (!data) {\n throw new Error(`npm view returned empty result for ${packageName}`);\n }\n\n let info = JSON.parse(data);\n if (Array.isArray(info)) {\n in", "suffix": "packageName}@${version}`, 'gitHead'],\n {cwd: repoRoot, maxBuffer: 1024 * 1024}\n );\n const possibleGitHead = gitHeadResult.stdout.trim();\n if (\n possibleGitHead &&\n possibleGitHead !== 'undefined' &&\n possibleGitHead !== 'null'\n", "middle": "fo = info[info.length - 1];\n }\n\n const version = info.version || info['dist-tags']?.latest;\n let gitHead = info.gitHead || null;\n\n if (!gitHead) {\n const gitHeadResult = await execFileAsync(\n 'npm',\n ['view', `${", "meta": {"filepath": "scripts/tasks/generate-changelog/data.js", "language": "javascript", "file_size": 4969, "cut_index": 614, "middle_length": 229}} +{"prefix": "ent',\n 'react-dom/profiling',\n 'react-dom/server.browser',\n 'react-dom/static.browser',\n 'react-dom/unstable_testing',\n 'react-dom/src/server/react-dom-server.browser',\n 'react-dom/src/server/ReactDOMFizzServerBrowser.js', // react-dom/server.browser\n 'react-dom/src/server/ReactDOMFizzStaticBrowser.js',\n 'react-dom-bindings/src/server/ReactDOMFlightServerHostDispatcher.js',\n 'react-dom-bindings/src/server/ReactFlightServerConfigDOM.js',\n 'react-dom-bindings/", "suffix": "server-dom-webpack/static.browser',\n 'react-server-dom-webpack/src/client/ReactFlightDOMClientBrowser.js', // react-server-dom-webpack/client.browser\n 'react-server-dom-webpack/src/client/ReactFlightClientConfigBundlerWebpack.js',\n 'react-se", "middle": "src/shared/ReactFlightClientConfigDOM.js',\n 'react-server-dom-webpack',\n 'react-server-dom-webpack/client',\n 'react-server-dom-webpack/client.browser',\n 'react-server-dom-webpack/server.browser',\n 'react-", "meta": {"filepath": "scripts/shared/inlinedHostConfigs.js", "language": "javascript", "file_size": 31532, "cut_index": 1331, "middle_length": 229}} +{"prefix": " strict';\n\nconst {join, relative} = require('path');\nconst {handleError} = require('./utils');\nconst yargs = require('yargs');\nconst clear = require('clear');\nconst theme = require('./theme');\nconst {\n downloadBuildArtifacts,\n} = require('./shared-commands/download-build-artifacts');\n\nconst argv = yargs.wrap(yargs.terminalWidth()).options({\n releaseChannel: {\n alias: 'r',\n describe: 'Download the given release channel.',\n requiresArg: true,\n type: 'string',\n choices: ['experimental', 'stabl", "suffix": "\n requiresArg: false,\n type: 'boolean',\n default: false,\n },\n}).argv;\n\nfunction printSummary(commit) {\n const commandPath = relative(\n process.env.PWD,\n join(__dirname, '../download-experimental-build.js')\n );\n\n clear();\n\n const message", "middle": "e'],\n default: 'experimental',\n },\n commit: {\n alias: 'c',\n describe: 'Commit hash to download.',\n requiresArg: true,\n demandOption: true,\n type: 'string',\n },\n noVerify: {\n describe: 'Skip verification',", "meta": {"filepath": "scripts/release/download-experimental-build.js", "language": "javascript", "file_size": 1531, "cut_index": 537, "middle_length": 229}} +{"prefix": " strict';\n\n// IMPORTANT:\n// Changes below should be mirrored in ../ci-add-build-info-json.js\n\nconst {existsSync} = require('fs');\nconst {writeJson, readJson} = require('fs-extra');\nconst {join} = require('path');\nconst {getPublicPackages, logPromise} = require('../utils');\nconst theme = require('../theme');\n\nconst run = async ({branch, checksum, commit, reactVersion, tempDirectory}) => {\n const isExperimental = reactVersion.includes('experimental');\n const packages = getPublicPackages(isExperimental);\n c", "suffix": "i++) {\n const packageName = packages[i];\n const packagePath = join(packagesDir, packageName);\n const packageJSON = await readJson(join(packagePath, 'package.json'));\n\n // Verify all public packages include \"build-info.json\" in the files array.\n", "middle": "onst packagesDir = join(tempDirectory, 'packages');\n\n const buildInfoJSON = {\n branch,\n buildNumber: null,\n checksum,\n commit,\n environment: 'local',\n reactVersion,\n };\n\n for (let i = 0; i < packages.length; ", "meta": {"filepath": "scripts/release/build-release-locally-commands/add-build-info-json.js", "language": "javascript", "file_size": 1582, "cut_index": 537, "middle_length": 229}} +{"prefix": "2Server = require('http2');\nconst httpServer = require('http-server');\nconst {existsSync, statSync, createReadStream} = require('fs');\nconst {join} = require('path');\nconst argv = require('minimist')(process.argv.slice(2));\nconst mime = require('mime');\n\nfunction sendFile(filename, response) {\n response.setHeader('Content-Type', mime.lookup(filename));\n response.writeHead(200);\n const fileStream = createReadStream(filename);\n fileStream.pipe(response);\n fileStream.on('finish', response.end);\n}\n\nfunctio", "suffix": ";\n\n if (existsSync(filename) && statSync(filename).isFile()) {\n sendFile(filename, response);\n } else {\n const indexHtmlPath = join(filename, 'index.html');\n\n if (existsSync(indexHtmlPath)) {\n sendFile(indexHtmlPath, response);\n", "middle": "n createHTTP2Server(benchmark) {\n const server = http2Server.createServer({}, (request, response) => {\n const filename = join(\n __dirname,\n 'benchmarks',\n benchmark,\n request.url\n ).replace(/\\?.*/g, '')", "meta": {"filepath": "scripts/bench/server.js", "language": "javascript", "file_size": 1920, "cut_index": 537, "middle_length": 229}} +{"prefix": "';\nconst REACT_VERSION_ENV = process.env.REACT_VERSION;\n\nfunction transform(babel) {\n const {types: t} = babel;\n\n // Runs tests conditionally based on the version of react (semver range) we are running\n // Input:\n // @reactVersion >= 17.0\n // test('some test', () => {/*...*/})\n //\n // Output:\n // @reactVersion >= 17.0\n // _test_react_version('>= 17.0', 'some test', () => {/*...*/});\n //\n // See info about semver ranges here:\n // https://www.npmjs.com/package/semver\n function buildGateV", "suffix": " if (!commentStr.startsWith(GATE_VERSION_STR)) {\n return accumulatedCondition;\n }\n\n const condition = commentStr.slice(GATE_VERSION_STR.length);\n if (accumulatedCondition === null) {\n return condition;\n }\n\n ", "middle": "ersionCondition(comments) {\n if (!comments) {\n return null;\n }\n\n const resultingCondition = comments.reduce(\n (accumulatedCondition, commentLine) => {\n const commentStr = commentLine.value.trim();\n\n ", "meta": {"filepath": "scripts/babel/transform-react-version-pragma.js", "language": "javascript", "file_size": 3509, "cut_index": 614, "middle_length": 229}} +{"prefix": "dule is the single source of truth for versioning packages that we\n// publish to npm.\n//\n// Packages will not be published unless they are added here.\n//\n// The @latest channel uses the version as-is, e.g.:\n//\n// 19.3.0\n//\n// The @canary channel appends additional information, with the scheme\n// -