@augu/eslint-config
Advanced tools
Comparing version 5.0.0 to 5.1.0
import { Linter } from 'eslint'; | ||
interface Options$2 { | ||
typescript?: boolean; | ||
} | ||
declare function astro({ typescript }?: Options$2): Promise<Linter.FlatConfig>; | ||
/** | ||
@@ -49,2 +54,10 @@ * Represents the options for configuring the TypeScript ESLint rules. | ||
/** | ||
* Enables the use of linting Astro files via [`eslint-plugin-astro`]. By default, if this is `true`, | ||
* then it will only validate JavaScript when parsing through Astro's frontmatter. If `{ typescript: true }` | ||
* is passed in, then TypeScript will also be validated through Astro's frontmatter. | ||
* | ||
* [`eslint-plugin-astro`]: https://npm.im/eslint-plugin-astro. | ||
*/ | ||
astro?: boolean | Options$2; | ||
/** | ||
* Enables the use of ESLint linting `.vue` files. | ||
@@ -68,4 +81,4 @@ */ | ||
*/ | ||
declare function noel(options?: Options, ...others: Linter.FlatConfig[]): Promise<Linter.FlatConfig[]>; | ||
declare function noel(opts?: Options, ...others: Linter.FlatConfig[]): Promise<Linter.FlatConfig[]>; | ||
export { type Options, type Options$1 as TsOptions, noel as default, javascript, perfectionist, typescript, vue }; | ||
export { type Options$2 as AstroOptions, type Options, type Options$1 as TsOptions, astro, noel as default, javascript, perfectionist, typescript, vue }; |
@@ -0,1 +1,23 @@ | ||
/* | ||
* 📜 @augu/eslint-config: Shareable ESLint configuration for my projects | ||
* Copyright (c) 2019-2024 Noel <cutie@floofy.dev> | ||
* | ||
* 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. | ||
*/ | ||
"use strict"; | ||
@@ -33,2 +55,3 @@ var __create = Object.create; | ||
__export(src_exports, { | ||
astro: () => astro, | ||
default: () => noel, | ||
@@ -41,6 +64,38 @@ javascript: () => javascript, | ||
module.exports = __toCommonJS(src_exports); | ||
var import_utils4 = require("@noelware/utils"); | ||
// src/configs/astro.ts | ||
var import_utils = require("@noelware/utils"); | ||
async function astro({ typescript: typescript2 } = {}) { | ||
const [plugin, parser] = await Promise.all([ | ||
await import("eslint-plugin-astro"), | ||
await import("astro-eslint-parser") | ||
]).then(([plugin2, parser2]) => [ | ||
(0, import_utils.hasOwnProperty)(plugin2, "default") ? plugin2.default : plugin2, | ||
(0, import_utils.hasOwnProperty)(parser2, "default") ? parser2.default : parser2 | ||
]); | ||
return { | ||
files: ["**/*.astro"], | ||
languageOptions: { | ||
parser, | ||
sourceType: "module", | ||
parserOptions: typescript2 !== void 0 && typescript2 ? { | ||
parser: await import("@typescript-eslint/parser").then( | ||
(m) => (0, import_utils.hasOwnProperty)(m, "default") ? m.default : m | ||
), | ||
sourceType: "module" | ||
} : void 0 | ||
}, | ||
plugins: { | ||
astro: plugin | ||
}, | ||
// @ts-ignore | ||
rules: plugin.configs.recommended.rules | ||
}; | ||
} | ||
// src/index.ts | ||
var import_utils5 = require("@noelware/utils"); | ||
// src/configs/typescript.ts | ||
var import_utils = require("@noelware/utils"); | ||
var import_utils2 = require("@noelware/utils"); | ||
var import_fs = require("fs"); | ||
@@ -132,3 +187,3 @@ var import_path = require("path"); | ||
let tsconfig = []; | ||
if ((0, import_utils.isObject)(configOrOpts)) { | ||
if ((0, import_utils2.isObject)(configOrOpts)) { | ||
if (configOrOpts.disableAutomaticTsConfigResolver !== void 0) { | ||
@@ -160,4 +215,4 @@ disableAutomaticTsConfigResolver = configOrOpts.disableAutomaticTsConfigResolver; | ||
const [parser, plugin] = await Promise.all([ | ||
import("@typescript-eslint/parser").then((m) => (0, import_utils.hasOwnProperty)(m, "default") ? m.default : m), | ||
import("@typescript-eslint/eslint-plugin").then((m) => (0, import_utils.hasOwnProperty)(m, "default") ? m.default : m) | ||
import("@typescript-eslint/parser").then((m) => (0, import_utils2.hasOwnProperty)(m, "default") ? m.default : m), | ||
import("@typescript-eslint/eslint-plugin").then((m) => (0, import_utils2.hasOwnProperty)(m, "default") ? m.default : m) | ||
]); | ||
@@ -184,6 +239,6 @@ return { | ||
// src/configs/perfectionist.ts | ||
var import_utils2 = require("@noelware/utils"); | ||
var import_utils3 = require("@noelware/utils"); | ||
async function perfectionist() { | ||
const plugin = await import("eslint-plugin-perfectionist").then( | ||
(m) => (0, import_utils2.hasOwnProperty)(m, "default") ? m.default : m | ||
(m) => (0, import_utils3.hasOwnProperty)(m, "default") ? m.default : m | ||
); | ||
@@ -337,7 +392,7 @@ return { | ||
// src/configs/vue.ts | ||
var import_utils3 = require("@noelware/utils"); | ||
var import_utils4 = require("@noelware/utils"); | ||
async function vue() { | ||
const [parser, plugin] = await Promise.all([ | ||
import("vue-eslint-parser").then((m) => (0, import_utils3.hasOwnProperty)(m, "default") ? m.default : m), | ||
import("eslint-plugin-vue").then((m) => (0, import_utils3.hasOwnProperty)(m, "default") ? m.default : m) | ||
import("vue-eslint-parser").then((m) => (0, import_utils4.hasOwnProperty)(m, "default") ? m.default : m), | ||
import("eslint-plugin-vue").then((m) => (0, import_utils4.hasOwnProperty)(m, "default") ? m.default : m) | ||
]); | ||
@@ -367,6 +422,7 @@ return { | ||
// src/index.ts | ||
var createLazilyResolver = (module2) => (0, import_utils4.lazy)(() => { | ||
var import_defu = __toESM(require("defu")); | ||
var createLazilyResolver = (module2) => (0, import_utils5.lazy)(() => { | ||
if (typeof require !== "undefined") { | ||
try { | ||
(0, import_utils4.tryRequire)(module2); | ||
(0, import_utils5.tryRequire)(module2); | ||
return true; | ||
@@ -381,27 +437,38 @@ } catch { | ||
var isPrettierAvailable = createLazilyResolver("prettier"); | ||
var isAstroAvailable = createLazilyResolver("eslint-plugin-astro"); | ||
var isVueAvailable = createLazilyResolver("vue"); | ||
var isTsAvailable = createLazilyResolver("typescript"); | ||
async function noel(options = { | ||
perfectionist: isPerfectionistPluginAvailable.get(), | ||
typescript: isTsAvailable.get(), | ||
vue: isVueAvailable.get() | ||
}, ...others) { | ||
async function noel(opts = {}, ...others) { | ||
const { perfectionist: perfectionist2, typescript: typescript2, astro: astro2, vue: vue2 } = (0, import_defu.default)(opts, { | ||
perfectionist: isPerfectionistPluginAvailable.get(), | ||
typescript: isTsAvailable.get(), | ||
astro: isAstroAvailable.get(), | ||
vue: isVueAvailable.get() | ||
}); | ||
const configs = [javascript()]; | ||
if (options.typescript !== void 0) { | ||
if (typeof options.typescript === "boolean") { | ||
if (typescript2 !== void 0) { | ||
if (typeof typescript2 === "boolean" && !!typescript2) { | ||
configs.push(await typescript()); | ||
} | ||
if (typeof options.typescript === "string" || (0, import_utils4.isObject)(options.typescript)) { | ||
configs.push(await typescript(options.typescript)); | ||
if (typeof typescript2 === "string" || (0, import_utils5.isObject)(typescript2)) { | ||
configs.push(await typescript(typescript2)); | ||
} | ||
} | ||
if (!!options.vue) { | ||
if (vue2 !== void 0 && !!vue2) { | ||
configs.push(await vue()); | ||
} | ||
if (!!options.perfectionist) { | ||
if (perfectionist2 !== void 0 && !!perfectionist2) { | ||
configs.push(await perfectionist()); | ||
} | ||
if (astro2 !== void 0) { | ||
if (typeof astro2 === "boolean" && !!astro2) { | ||
configs.push(await astro()); | ||
} | ||
if ((0, import_utils5.isObject)(astro2)) { | ||
configs.push(await astro(astro2)); | ||
} | ||
} | ||
if (isPrettierAvailable.get()) { | ||
const config = await import("eslint-config-prettier").then( | ||
(m) => (0, import_utils4.hasOwnProperty)(m, "default") ? m.default : m | ||
(m) => (0, import_utils5.hasOwnProperty)(m, "default") ? m.default : m | ||
); | ||
@@ -414,2 +481,3 @@ configs.push(config); | ||
0 && (module.exports = { | ||
astro, | ||
javascript, | ||
@@ -420,1 +488,2 @@ perfectionist, | ||
}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@augu/eslint-config", | ||
"description": "📜 @augu/eslint-config is Noel's shared configuration for his projects and for Noelware as well", | ||
"version": "5.0.0", | ||
"version": "5.1.0", | ||
"license": "MIT", | ||
"author": "Noel <cutie@floofy.dev>", | ||
"repository": "https://github.com/auguwu/eslint-config", | ||
"packageManager": "yarn@4.0.2", | ||
"files": [ | ||
"dist" | ||
"dist", | ||
"src" | ||
], | ||
@@ -20,3 +20,3 @@ "exports": { | ||
"scripts": { | ||
"build": "tsup --clean --format cjs src/index.ts && tsup --dts --format esm src/index.ts && mv dist/index.d.mts dist/index.d.ts", | ||
"build": "tsup-node ./src/index.ts && rm dist/index.d.mts", | ||
"lint": "bun run scripts/eslint.ts", | ||
@@ -46,2 +46,8 @@ "fmt": "bun run scripts/prettier.ts" | ||
"optional": true | ||
}, | ||
"astro-eslint-parser": { | ||
"optional": true | ||
}, | ||
"eslint-plugin-astro": { | ||
"optional": true | ||
} | ||
@@ -52,24 +58,26 @@ }, | ||
"@noelware/utils": "2.4.0", | ||
"@typescript-eslint/eslint-plugin": "6.14.0", | ||
"@typescript-eslint/parser": "6.14.0", | ||
"eslint-config-prettier": "9.1.0", | ||
"eslint-plugin-antfu": "2.0.0", | ||
"eslint-plugin-perfectionist": "2.5.0", | ||
"eslint-plugin-vue": "9.19.2", | ||
"@typescript-eslint/eslint-plugin": "6.21.0", | ||
"@typescript-eslint/parser": "6.21.0", | ||
"defu": "6.1.4", | ||
"local-pkg": "0.5.0", | ||
"vue-eslint-parser": "9.3.2" | ||
"vue-eslint-parser": "9.4.2" | ||
}, | ||
"devDependencies": { | ||
"@augu/tsconfig": "1.2.0", | ||
"@types/eslint": "8.44.9", | ||
"@types/node": "20.10.4", | ||
"bun-types": "1.0.18", | ||
"@types/bun": "1.0.4", | ||
"@types/eslint": "8.56.2", | ||
"@types/node": "20.11.16", | ||
"astro-eslint-parser": "0.16.3", | ||
"colorette": "2.0.20", | ||
"eslint": "8.55.0", | ||
"eslint": "8.56.0", | ||
"eslint-config-prettier": "9.1.0", | ||
"eslint-formatter-codeframe": "7.32.1", | ||
"prettier": "3.1.1", | ||
"eslint-plugin-antfu": "2.1.2", | ||
"eslint-plugin-astro": "0.31.4", | ||
"eslint-plugin-perfectionist": "2.5.0", | ||
"eslint-plugin-vue": "9.21.1", | ||
"prettier": "3.2.5", | ||
"tsup": "8.0.1", | ||
"tsx": "4.6.2", | ||
"typescript": "5.3.3" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
143681
7
14
1594
0
16
+ Addeddefu@6.1.4
+ Added@typescript-eslint/eslint-plugin@6.21.0(transitive)
+ Added@typescript-eslint/parser@6.21.0(transitive)
+ Added@typescript-eslint/scope-manager@6.21.0(transitive)
+ Added@typescript-eslint/type-utils@6.21.0(transitive)
+ Added@typescript-eslint/types@6.21.0(transitive)
+ Added@typescript-eslint/typescript-estree@6.21.0(transitive)
+ Added@typescript-eslint/utils@6.21.0(transitive)
+ Added@typescript-eslint/visitor-keys@6.21.0(transitive)
+ Addeddefu@6.1.4(transitive)
+ Addedminimatch@9.0.3(transitive)
+ Addedvue-eslint-parser@9.4.2(transitive)
- Removedeslint-config-prettier@9.1.0
- Removedeslint-plugin-antfu@2.0.0
- Removedeslint-plugin-perfectionist@2.5.0
- Removedeslint-plugin-vue@9.19.2
- Removed@typescript-eslint/eslint-plugin@6.14.0(transitive)
- Removed@typescript-eslint/parser@6.14.0(transitive)
- Removed@typescript-eslint/scope-manager@6.14.0(transitive)
- Removed@typescript-eslint/type-utils@6.14.0(transitive)
- Removed@typescript-eslint/types@6.14.0(transitive)
- Removed@typescript-eslint/typescript-estree@6.14.0(transitive)
- Removed@typescript-eslint/utils@6.14.0(transitive)
- Removed@typescript-eslint/visitor-keys@6.14.0(transitive)
- Removedboolbase@1.0.0(transitive)
- Removedcssesc@3.0.0(transitive)
- Removedeslint-config-prettier@9.1.0(transitive)
- Removedeslint-plugin-antfu@2.0.0(transitive)
- Removedeslint-plugin-perfectionist@2.5.0(transitive)
- Removedeslint-plugin-vue@9.19.2(transitive)
- Removedminimatch@9.0.4(transitive)
- Removednatural-compare-lite@1.4.0(transitive)
- Removednth-check@2.1.1(transitive)
- Removedpostcss-selector-parser@6.1.0(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedvue-eslint-parser@9.3.2(transitive)
- Removedxml-name-validator@4.0.0(transitive)
Updatedvue-eslint-parser@9.4.2