including-modules

This commit is contained in:
Kismet Hasanaj
2026-05-03 00:14:08 +02:00
parent ec83a0d879
commit 39a8a128be
20434 changed files with 3906546 additions and 3 deletions
+3
View File
@@ -0,0 +1,3 @@
import type { Linter } from 'eslint';
declare const config: Linter.Config[];
export = config;
+37
View File
@@ -0,0 +1,37 @@
"use strict";
var _eslintpluginnext = /*#__PURE__*/ _interop_require_default(require("@next/eslint-plugin-next"));
var _index = /*#__PURE__*/ _interop_require_default(require("./index"));
function _array_like_to_array(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
return arr2;
}
function _array_without_holes(arr) {
if (Array.isArray(arr)) return _array_like_to_array(arr);
}
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _iterable_to_array(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _non_iterable_spread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _to_consumable_array(arr) {
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
}
function _unsupported_iterable_to_array(o, minLen) {
if (!o) return;
if (typeof o === "string") return _array_like_to_array(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(n);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
}
var config = _to_consumable_array(_index.default).concat([
_eslintpluginnext.default.configs['core-web-vitals']
]);
module.exports = config;
+3
View File
@@ -0,0 +1,3 @@
import type { Linter } from 'eslint';
declare const config: Linter.Config[];
export = config;
+221
View File
@@ -0,0 +1,221 @@
"use strict";
var _eslintpluginnext = /*#__PURE__*/ _interop_require_default(require("@next/eslint-plugin-next"));
var _eslintpluginreact = /*#__PURE__*/ _interop_require_default(require("eslint-plugin-react"));
var _eslintpluginreacthooks = /*#__PURE__*/ _interop_require_default(require("eslint-plugin-react-hooks"));
var _typescripteslint = /*#__PURE__*/ _interop_require_default(require("typescript-eslint"));
var _eslintpluginimport = /*#__PURE__*/ _interop_require_wildcard(require("eslint-plugin-import"));
var _eslintpluginjsxa11y = /*#__PURE__*/ _interop_require_wildcard(require("eslint-plugin-jsx-a11y"));
var _globals = /*#__PURE__*/ _interop_require_default(require("globals"));
var _parser = /*#__PURE__*/ _interop_require_default(require("./parser"));
function _define_property(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
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);
}
function _interop_require_wildcard(obj, nodeInterop) {
if (!nodeInterop && obj && obj.__esModule) {
return obj;
}
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
return {
default: obj
};
}
var cache = _getRequireWildcardCache(nodeInterop);
if (cache && cache.has(obj)) {
return cache.get(obj);
}
var newObj = {
__proto__: null
};
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
for(var key in obj){
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
if (desc && (desc.get || desc.set)) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
newObj.default = obj;
if (cache) {
cache.set(obj, newObj);
}
return newObj;
}
function _object_spread(target) {
for(var i = 1; i < arguments.length; i++){
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === "function") {
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}
ownKeys.forEach(function(key) {
_define_property(target, key, source[key]);
});
}
return target;
}
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) {
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
}
keys.push.apply(keys, symbols);
}
return keys;
}
function _object_spread_props(target, source) {
source = source != null ? source : {};
if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
return target;
}
var config = [
{
name: 'next',
// Default files, users can overwrite this.
files: [
'**/*.{js,jsx,mjs,ts,tsx,mts,cts}'
],
plugins: {
react: _eslintpluginreact.default,
'react-hooks': _eslintpluginreacthooks.default,
import: _eslintpluginimport,
'jsx-a11y': _eslintpluginjsxa11y,
'@next/next': _eslintpluginnext.default
},
languageOptions: {
parser: _parser.default,
parserOptions: {
requireConfigFile: false,
sourceType: 'module',
allowImportExportEverywhere: true,
// TODO: Is this needed?
babelOptions: {
presets: [
'next/babel'
],
caller: {
// Eslint supports top level await when a parser for it is included. We enable the parser by default for Babel.
supportsTopLevelAwait: true
}
}
},
globals: _object_spread({}, _globals.default.browser, _globals.default.node)
},
settings: {
react: {
version: 'detect'
},
'import/parsers': {
'@typescript-eslint/parser': [
'.ts',
'.mts',
'.cts',
'.tsx',
'.d.ts'
]
},
'import/resolver': {
node: {
extensions: [
'.js',
'.jsx',
'.ts',
'.tsx'
]
},
typescript: {
alwaysTryTypes: true
}
}
},
rules: _object_spread_props(_object_spread({}, _eslintpluginreact.default.configs.recommended.rules, _eslintpluginreacthooks.default.configs.recommended.rules, _eslintpluginnext.default.configs.recommended.rules), {
'import/no-anonymous-default-export': 'warn',
'react/no-unknown-property': 'off',
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'jsx-a11y/alt-text': [
'warn',
{
elements: [
'img'
],
img: [
'Image'
]
}
],
'jsx-a11y/aria-props': 'warn',
'jsx-a11y/aria-proptypes': 'warn',
'jsx-a11y/aria-unsupported-elements': 'warn',
'jsx-a11y/role-has-required-aria-props': 'warn',
'jsx-a11y/role-supports-aria-props': 'warn',
'react/jsx-no-target-blank': 'off'
})
},
{
name: 'next/typescript',
// Default files, users can overwrite this.
files: [
'**/*.ts',
'**/*.tsx'
],
plugins: {
'@typescript-eslint': _typescripteslint.default.plugin
},
languageOptions: {
parser: _typescripteslint.default.parser,
parserOptions: {
sourceType: 'module'
}
}
},
// Global ignores, users can add more `ignores` or overwrite this by `!<ignore>`.
{
ignores: [
// node_modules/ and .git/ are ignored by default.
// https://eslint.org/docs/latest/use/configure/configuration-files#globally-ignoring-files-with-ignores
'.next/**',
'out/**',
'build/**',
'next-env.d.ts'
]
}
];
module.exports = config;
+3
View File
@@ -0,0 +1,3 @@
import type { Linter } from 'eslint';
declare const parser: Linter.Parser;
export = parser;
+12
View File
@@ -0,0 +1,12 @@
"use strict";
var _eslintparser = require("next/dist/compiled/babel/eslint-parser");
var _packagejson = require("../package.json");
var parser = {
parse: _eslintparser.parse,
parseForESLint: _eslintparser.parseForESLint,
meta: {
name: 'eslint-config-next/parser',
version: _packagejson.version
}
};
module.exports = parser;
+3
View File
@@ -0,0 +1,3 @@
import type { Linter } from 'eslint';
declare const config: Linter.Config[];
export = config;
+52
View File
@@ -0,0 +1,52 @@
"use strict";
var _typescripteslint = /*#__PURE__*/ _interop_require_default(require("typescript-eslint"));
function _array_like_to_array(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
return arr2;
}
function _array_without_holes(arr) {
if (Array.isArray(arr)) return _array_like_to_array(arr);
}
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _iterable_to_array(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _non_iterable_spread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _to_consumable_array(arr) {
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
}
function _unsupported_iterable_to_array(o, minLen) {
if (!o) return;
if (typeof o === "string") return _array_like_to_array(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(n);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
}
var config = _to_consumable_array(_typescripteslint.default.configs.recommended).concat([
{
rules: {
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-unused-expressions': 'warn'
}
},
// Global ignores, users can add more `ignores` or overwrite this by `!<ignore>`.
{
ignores: [
// node_modules/ and .git/ are ignored by default.
// https://eslint.org/docs/latest/use/configure/configuration-files#globally-ignoring-files-with-ignores
'.next/**',
'out/**',
'build/**',
'next-env.d.ts'
]
}
]);
module.exports = config;
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+2
View File
@@ -0,0 +1,2 @@
'use strict';
module.exports = require('./globals.json');
+9
View File
@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+116
View File
@@ -0,0 +1,116 @@
{
"name": "globals",
"version": "16.4.0",
"description": "Global identifiers from different JavaScript environments",
"license": "MIT",
"repository": "sindresorhus/globals",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"sideEffects": false,
"engines": {
"node": ">=18"
},
"scripts": {
"test": "npm run build && xo && ava && tsd",
"prepare": "npm run build",
"update": "node scripts/update.mjs",
"update:browser": "node scripts/update.mjs --job=browser",
"update:builtin": "node scripts/update.mjs --job=builtin",
"update:builtin-yearly": "node scripts/update.mjs --job=builtin-yearly",
"update:nodeBuiltin": "node scripts/update.mjs --job=nodeBuiltin",
"update:worker": "node scripts/update.mjs --job=worker",
"update:serviceworker": "node scripts/update.mjs --job=serviceworker",
"update:shelljs": "node scripts/update.mjs --job=shelljs",
"update:jest": "node scripts/update.mjs --job=jest",
"update:vitest": "node scripts/update.mjs --job=vitest",
"build": "run-s build:data build:types",
"build:data": "node scripts/generate-data.mjs",
"build:types": "node scripts/generate-types.mjs"
},
"files": [
"index.js",
"index.d.ts",
"globals.json"
],
"keywords": [
"globals",
"global",
"identifiers",
"variables",
"vars",
"jshint",
"eslint",
"environments"
],
"devDependencies": {
"@vitest/eslint-plugin": "^1.1.44",
"ava": "^6.3.0",
"cheerio": "^1.0.0",
"eslint-plugin-jest": "^28.11.0",
"get-port": "^7.1.0",
"nano-spawn": "^0.2.0",
"npm-run-all2": "^8.0.1",
"outdent": "^0.8.0",
"puppeteer": "^24.19.0",
"shelljs": "^0.9.2",
"tsd": "^0.32.0",
"type-fest": "^4.41.0",
"xo": "^0.60.0"
},
"xo": {
"rules": {
"unicorn/prefer-module": "off"
},
"overrides": [
{
"files": [
"data/*.mjs"
],
"rules": {
"import/no-anonymous-default-export": "off",
"camelcase": "off",
"unicorn/filename-case": [
"error",
{
"cases": {
"camelCase": true,
"kebabCase": true
}
}
]
}
},
{
"files": [
"scripts/*.mjs"
],
"rules": {
"n/no-unsupported-features/node-builtins": "off"
}
},
{
"files": [
"scripts/browser/assets/**/*.mjs"
],
"envs": [
"browser",
"worker",
"serviceworker"
],
"rules": {
"n/no-unsupported-features/node-builtins": "off",
"unicorn/prefer-add-event-listener": "off"
}
}
]
},
"tsd": {
"compilerOptions": {
"resolveJsonModule": true
}
}
}
+42
View File
@@ -0,0 +1,42 @@
# globals
> Global identifiers from different JavaScript environments
It's just a [JSON file](globals.json), so you can use it in any environment.
This package is used by ESLint 8 and earlier. For ESLint 9 and later, you should depend on this package directly in [your ESLint config](https://eslint.org/docs/latest/use/configure/language-options#predefined-global-variables).
## Install
```sh
npm install globals
```
## Usage
```js
import globals from 'globals';
console.log(globals.browser);
/*
{
addEventListener: false,
applicationCache: false,
ArrayBuffer: false,
atob: false,
}
*/
```
Each global is given a value of `true` or `false`. A value of `true` indicates that the variable may be overwritten. A value of `false` indicates that the variable should be considered read-only. This information is used by static analysis tools to flag incorrect behavior. We assume all variables should be `false` unless we hear otherwise.
For Node.js this package provides two sets of globals:
- `globals.nodeBuiltin`: Globals available to all code running in Node.js.
These will usually be available as properties on the `globalThis` object and include `process`, `Buffer`, but not CommonJS arguments like `require`.
See: https://nodejs.org/api/globals.html
- `globals.node`: A combination of the globals from `nodeBuiltin` plus all CommonJS arguments ("CommonJS module scope").
See: https://nodejs.org/api/modules.html#modules_the_module_scope
When analyzing code that is known to run outside of a CommonJS wrapper, for example, JavaScript modules, `nodeBuiltin` can find accidental CommonJS references.
+63
View File
@@ -0,0 +1,63 @@
{
"name": "eslint-config-next",
"version": "16.1.6",
"description": "ESLint configuration used by Next.js.",
"license": "MIT",
"repository": {
"url": "vercel/next.js",
"directory": "packages/eslint-config-next"
},
"homepage": "https://nextjs.org/docs/app/api-reference/config/eslint",
"files": [
"dist"
],
"dependencies": {
"@next/eslint-plugin-next": "16.1.6",
"eslint-import-resolver-node": "^0.3.6",
"eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsx-a11y": "^6.10.0",
"eslint-plugin-react": "^7.37.0",
"eslint-plugin-react-hooks": "^7.0.0",
"globals": "16.4.0",
"typescript-eslint": "^8.46.0"
},
"peerDependencies": {
"eslint": ">=9.0.0",
"typescript": ">=3.3.1"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
},
"devDependencies": {
"@types/eslint": "9.6.1",
"@types/eslint-plugin-jsx-a11y": "6.10.1",
"typescript": "5.9.2"
},
"scripts": {
"dev": "pnpm build",
"build": "swc -d dist src && pnpm types",
"types": "tsc --skipLibCheck --declaration --emitDeclarationOnly --esModuleInterop --declarationDir dist --rootDir src",
"prepublishOnly": "cd ../../ && turbo run build"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./core-web-vitals": {
"types": "./dist/core-web-vitals.d.ts",
"default": "./dist/core-web-vitals.js"
},
"./typescript": {
"types": "./dist/typescript.d.ts",
"default": "./dist/typescript.js"
},
"./parser": {
"types": "./dist/parser.d.ts",
"default": "./dist/parser.js"
}
}
}