@darksheep/eslint 4.1.8 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/package.json +8 -4
  3. package/types/eslint.config.d.ts +2 -0
  4. package/types/src/bin/eslint.d.cts +2 -0
  5. package/types/src/configs/eslint-base.d.ts +5 -0
  6. package/types/src/configs/eslint-complexity.d.ts +5 -0
  7. package/types/src/configs/eslint-ignores.d.ts +6 -0
  8. package/types/src/configs/eslint-recommended.d.ts +5 -0
  9. package/types/src/configs/eslint-style.d.ts +6 -0
  10. package/types/src/custom/index.d.ts +8 -0
  11. package/types/src/custom/instance-of-array.d.ts +3 -0
  12. package/types/src/custom/loose-types.d.ts +3 -0
  13. package/types/src/custom/no-useless-expression.d.ts +3 -0
  14. package/types/src/custom/sequence-expression.d.ts +3 -0
  15. package/types/src/index.d.ts +8 -0
  16. package/types/src/plugins/eslint-comments.d.ts +5 -0
  17. package/types/src/plugins/import.d.ts +6 -0
  18. package/types/src/plugins/jest.d.ts +6 -0
  19. package/types/src/plugins/jsdoc.d.ts +6 -0
  20. package/types/src/plugins/json.d.ts +5 -0
  21. package/types/src/plugins/jsx-a11y.d.ts +5 -0
  22. package/types/src/plugins/node.d.ts +6 -0
  23. package/types/src/plugins/promise.d.ts +5 -0
  24. package/types/src/plugins/react.d.ts +6 -0
  25. package/types/src/plugins/regexp.d.ts +6 -0
  26. package/types/src/plugins/sca.d.ts +6 -0
  27. package/types/src/plugins/security.d.ts +5 -0
  28. package/types/src/plugins/sonarjs.d.ts +6 -0
  29. package/types/src/plugins/style.d.ts +5 -0
  30. package/types/src/plugins/typescript.d.ts +6 -0
  31. package/types/src/plugins/unicorn.d.ts +6 -0
  32. package/types/src/plugins/unused-imports.d.ts +6 -0
  33. package/types/src/utilities/editorconfig.d.ts +27 -0
  34. package/types/src/utilities/eslint-files.d.ts +32 -0
  35. package/types/src/utilities/expand-glob.d.ts +5 -0
  36. package/types/src/utilities/filesystem.d.ts +27 -0
  37. package/types/src/utilities/make-compat.d.ts +5 -0
  38. package/types/src/utilities/package.d.ts +7 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.2.0](https://github.com/DarkSheepSoftware/eslint/compare/v4.1.8...v4.2.0) (2024-03-06)
4
+
5
+
6
+ ### 💡 Features
7
+
8
+ * builtin ts types ([564facf](https://github.com/DarkSheepSoftware/eslint/commit/564facf2e27b27e15db026118e5342dafb2cad8d))
9
+
10
+
11
+ ### 📦 Dependencies
12
+
13
+ * **deps:** update yarn to v4.1.1 ([#282](https://github.com/DarkSheepSoftware/eslint/issues/282)) ([c9af1d8](https://github.com/DarkSheepSoftware/eslint/commit/c9af1d84596926fe2aa75c5e9cb20fc1e853452a))
14
+ * **dev:** update dependency type-fest to v4.11.1 ([#258](https://github.com/DarkSheepSoftware/eslint/issues/258)) ([00a0fa3](https://github.com/DarkSheepSoftware/eslint/commit/00a0fa33ae4d7de182953a29a9b3ae786e3a396e))
15
+ * **pkg:** update typescript-eslint monorepo to v7.1.1 ([#280](https://github.com/DarkSheepSoftware/eslint/issues/280)) ([7653003](https://github.com/DarkSheepSoftware/eslint/commit/765300359b074c5eec9d1dbc06474d2f307b43e6))
16
+
3
17
  ## [4.1.8](https://github.com/DarkSheepSoftware/eslint/compare/v4.1.7...v4.1.8) (2024-03-04)
4
18
 
5
19
 
package/package.json CHANGED
@@ -1,14 +1,18 @@
1
1
  {
2
2
  "name": "@darksheep/eslint",
3
- "version": "4.1.8",
3
+ "version": "4.2.0",
4
4
  "type": "module",
5
- "packageManager": "yarn@4.1.0",
5
+ "packageManager": "yarn@4.1.1",
6
6
  "bin": "./src/bin/eslint.cjs",
7
7
  "exports": {
8
- ".": "./src/index.js"
8
+ ".": {
9
+ "import": "./src/index.js",
10
+ "types": "./types/src/index.d.ts"
11
+ }
9
12
  },
10
13
  "files": [
11
- "src"
14
+ "src",
15
+ "types"
12
16
  ],
13
17
  "engines": {
14
18
  "node": "^20 || ^21"
@@ -0,0 +1,2 @@
1
+ export default config;
2
+ declare const config: import("eslint").Linter.FlatConfig[];
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Get the ESLint base config
3
+ * @returns {Promise<import('eslint').Linter.FlatConfig[]>}
4
+ */
5
+ export function createEslintBaseConfig(): Promise<import('eslint').Linter.FlatConfig[]>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Get the ESLint config for complexity checks
3
+ * @returns {import('eslint').Linter.FlatConfig[]}
4
+ */
5
+ export function createEslintComplexityConfig(): import('eslint').Linter.FlatConfig[];
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get basic ESLint ignores config
3
+ * @param {import('node:url').URL} root root url
4
+ * @returns {Promise<import('eslint').Linter.FlatConfig[]>}
5
+ */
6
+ export function createEslintIgnoresConfig(root: import('node:url').URL): Promise<import('eslint').Linter.FlatConfig[]>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Get recommended ESLint config
3
+ * @returns {Promise<import('eslint').Linter.FlatConfig[]>}
4
+ */
5
+ export function createEslintRecommendsConfig(): Promise<import('eslint').Linter.FlatConfig[]>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get basic ESLint style config
3
+ * @param {import('node:url').URL} root root url
4
+ * @returns {Promise<import('eslint').Linter.FlatConfig[]>}
5
+ */
6
+ export function createStyleConfigs(root: import('node:url').URL): Promise<import('eslint').Linter.FlatConfig[]>;
@@ -0,0 +1,8 @@
1
+ declare namespace _default {
2
+ let rules: {
3
+ 'loose-types': import("eslint").Rule.RuleModule;
4
+ 'no-useless-expression': import("eslint").Rule.RuleModule;
5
+ 'sequence-expression': import("eslint").Rule.RuleModule;
6
+ };
7
+ }
8
+ export default _default;
@@ -0,0 +1,3 @@
1
+ export default rule;
2
+ /** @type {import('eslint').Rule.RuleModule} */
3
+ declare const rule: import('eslint').Rule.RuleModule;
@@ -0,0 +1,3 @@
1
+ export default rule;
2
+ /** @type {import('eslint').Rule.RuleModule} */
3
+ declare const rule: import('eslint').Rule.RuleModule;
@@ -0,0 +1,3 @@
1
+ export default rule;
2
+ /** @type {import('eslint').Rule.RuleModule} */
3
+ declare const rule: import('eslint').Rule.RuleModule;
@@ -0,0 +1,3 @@
1
+ export default rule;
2
+ /** @type {import('eslint').Rule.RuleModule} */
3
+ declare const rule: import('eslint').Rule.RuleModule;
@@ -0,0 +1,8 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ /**
3
+ * @param {string | URL} root root url
4
+ * @returns {Promise<import('eslint').Linter.FlatConfig[]>}
5
+ */
6
+ export function createConfig(root: string | URL): Promise<import('eslint').Linter.FlatConfig[]>;
7
+ export * from "eslint";
8
+ import { URL } from 'node:url';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Get ESLint config for comments check
3
+ * @returns {import('eslint').Linter.FlatConfig[]}
4
+ */
5
+ export function createEslintCommentsConfig(): import('eslint').Linter.FlatConfig[];
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get ESLint config for imports check
3
+ * @param {import('node:url').URL} root The root of the eslint config directory
4
+ * @returns {Promise<import('eslint').Linter.FlatConfig[]>}
5
+ */
6
+ export function createEslintImportConfig(root: import('node:url').URL): Promise<import('eslint').Linter.FlatConfig[]>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get ESLint config jest plugin
3
+ * @param {import('node:url').URL} root root url
4
+ * @returns {Promise<import('eslint').Linter.FlatConfig[]>}
5
+ */
6
+ export function createEslintJestConfig(root: import('node:url').URL): Promise<import('eslint').Linter.FlatConfig[]>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get ESLint config for js docs
3
+ * @param {URL} root The root of the package being linted
4
+ * @returns {Promise<import('eslint').Linter.FlatConfig[]>}
5
+ */
6
+ export function createEslintJSDocConfig(root: URL): Promise<import('eslint').Linter.FlatConfig[]>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Get ESLint config for imports check
3
+ * @returns {Promise<import('eslint').Linter.FlatConfig[]>}
4
+ */
5
+ export function createEslintJsonConfig(): Promise<import('eslint').Linter.FlatConfig[]>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Get ESLint config for imports check
3
+ * @returns {Promise<import('eslint').Linter.FlatConfig[]>}
4
+ */
5
+ export function createEslintJsxA11yConfig(): Promise<import('eslint').Linter.FlatConfig[]>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get ESLint config for the node plugin
3
+ * @param {URL} root root url
4
+ * @returns {Promise<import('eslint').Linter.FlatConfig[]>}
5
+ */
6
+ export function createEslintNodeConfigs(root: URL): Promise<import('eslint').Linter.FlatConfig[]>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Get ESLint config for the promise plugin
3
+ * @returns {import('eslint').Linter.FlatConfig[]}
4
+ */
5
+ export function createEslintPromiseConfig(): import('eslint').Linter.FlatConfig[];
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get ESLint config for imports check
3
+ * @param {URL} root The root of the package being linted
4
+ * @returns {Promise<import('eslint').Linter.FlatConfig[]>}
5
+ */
6
+ export function createEslintReactConfig(root: URL): Promise<import('eslint').Linter.FlatConfig[]>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get ESLint config for the regexp plugin
3
+ * @param {import('node:url').URL} root root url
4
+ * @returns {import('eslint').Linter.FlatConfig[]}
5
+ */
6
+ export function createEslintRegexpConfig(root: import('node:url').URL): import('eslint').Linter.FlatConfig[];
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get ESLint config for the sca plugin
3
+ * @param {URL} root The root url of the package we are linting
4
+ * @returns {Promise<import('eslint').Linter.FlatConfig[]>}
5
+ */
6
+ export function createEslintSCAConfig(root: URL): Promise<import('eslint').Linter.FlatConfig[]>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Get ESLint config for the security plugin
3
+ * @returns {import('eslint').Linter.FlatConfig[]}
4
+ */
5
+ export function createEslintSecurityConfig(): import('eslint').Linter.FlatConfig[];
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get ESLint config for the sonar plugin
3
+ * @param {import('node:url').URL} root root url
4
+ * @returns {import('eslint').Linter.FlatConfig[]}
5
+ */
6
+ export function createEslintSonarJSConfig(root: import('node:url').URL): import('eslint').Linter.FlatConfig[];
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Get ESLint config for the sonar plugin
3
+ * @returns {import('eslint').Linter.FlatConfig[]}
4
+ */
5
+ export function createEslintStyleConfig(): import('eslint').Linter.FlatConfig[];
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get ESLint config for the typescript plugin
3
+ * @param {import('node:url').URL} root root url
4
+ * @returns {Promise<import('eslint').Linter.FlatConfig[]>}
5
+ */
6
+ export function createEslintTypescriptConfig(root: import('node:url').URL): Promise<import('eslint').Linter.FlatConfig[]>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get ESLint config for the unicorn plugin
3
+ * @param {import('node:url').URL} root root url
4
+ * @returns {Promise<import('eslint').Linter.FlatConfig[]>}
5
+ */
6
+ export function createEslintUnicornConfig(root: import('node:url').URL): Promise<import('eslint').Linter.FlatConfig[]>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get ESLint config for the unused import plugin
3
+ * @param {import('node:url').URL} root root url
4
+ * @returns {Promise<import('eslint').Linter.FlatConfig[]>}
5
+ */
6
+ export function createEslintUnusedImportsConfig(root: import('node:url').URL): Promise<import('eslint').Linter.FlatConfig[]>;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @param {import('node:url').URL} root root url
3
+ * @returns {Promise<import('eslint').Linter.FlatConfig[]>}
4
+ */
5
+ export function createEditorOverrides(root: import('node:url').URL): Promise<import('eslint').Linter.FlatConfig[]>;
6
+ export type RuleSet = {
7
+ /**
8
+ * end of line
9
+ */
10
+ EOL: string;
11
+ /**
12
+ * line feed
13
+ */
14
+ LF: string;
15
+ /**
16
+ * trailing spaces
17
+ */
18
+ TRAIL: string;
19
+ /**
20
+ * indent size
21
+ */
22
+ INDENT: string;
23
+ /**
24
+ * indent binary ops size
25
+ */
26
+ INDENT_BINARY?: string | undefined;
27
+ };
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Get a list of globs for common js files
3
+ * @returns {Promise<string[]>}
4
+ */
5
+ export function getJsonFiles(): Promise<string[]>;
6
+ /**
7
+ * Get a list of globs for common js files
8
+ * @param {import('node:url').URL} root root url
9
+ * @returns {Promise<string[]>}
10
+ */
11
+ export function getCommonFiles(root: import('node:url').URL): Promise<string[]>;
12
+ /**
13
+ * Get a list of globs for module files
14
+ * @param {import('node:url').URL} root root url
15
+ * @returns {Promise<string[]>}
16
+ */
17
+ export function getModuleFiles(root: import('node:url').URL): Promise<string[]>;
18
+ /**
19
+ * Get a list of globs for typescript files
20
+ * @returns {string[]}
21
+ */
22
+ export function getTypescriptFiles(): string[];
23
+ /**
24
+ * Get a list of possible example files
25
+ * @returns {string[]}
26
+ */
27
+ export function getTestFiles(): string[];
28
+ /**
29
+ * Get a list of possible example files
30
+ * @returns {string[]}
31
+ */
32
+ export function getExampleFiles(): string[];
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @param {string} input The glob to process
3
+ * @returns {string[]}
4
+ */
5
+ export function expandGlob(input: string): string[];
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @param {string} path The absolute path to the file to check
3
+ * @returns {Promise<boolean>}
4
+ */
5
+ export function exists(path: string): Promise<boolean>;
6
+ /**
7
+ * Does {filePath} exist in {projectPath}
8
+ * @param {string} [filePath] The path of the file to check
9
+ * @param {string} [projectPath] The path to the project root
10
+ * @returns {boolean}
11
+ */
12
+ export function descendsFrom(filePath?: string | undefined, projectPath?: string | undefined): boolean;
13
+ /**
14
+ * Create a list of parent directories from {filepath} to {stopDirectory}
15
+ * @param {string} filepath The file to start from
16
+ * @param {string} [stopDirectory] The directory to stop at
17
+ * @returns {string[]}
18
+ */
19
+ export function listParents(filepath: string, stopDirectory?: string | undefined): string[];
20
+ /**
21
+ * Find the closest {filename} starting from {rootFilePath}
22
+ * @param {string} rootFilePath The file to start the search from
23
+ * @param {string} filename The filename to find
24
+ * @param {string} [stopDirectory] The directory to stop searching at
25
+ * @returns {Promise<string|null>} Returns absolute path to the closest {filename} if found
26
+ */
27
+ export function findUp(rootFilePath: string, filename: string, stopDirectory?: string | undefined): Promise<string | null>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @param {import('node:url').URL} root root url
3
+ * @returns {import('@eslint/eslintrc').FlatCompat}
4
+ */
5
+ export function makeCompat(root: import('node:url').URL): import('@eslint/eslintrc').FlatCompat;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Get the path of the eslint package json
3
+ * @param {import('node:url').URL} root root url
4
+ * @param {string} [packageName] The name of the npm package
5
+ * @returns {Promise<import('type-fest').PackageJson | null>}
6
+ */
7
+ export function getPackageJson(root: import('node:url').URL, packageName?: string | undefined): Promise<import('type-fest').PackageJson | null>;