@halospv3/hce.shared-config
Version:
Automate commit message quality, changelogs, and CI/CD releases. Exports a semantic-release shareable configuration deserialized from this package's '.releaserc.yml'. Shared resources for .NET projects are also distributed with this package.
64 lines (61 loc) • 3.65 kB
JavaScript
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
import eslint from '@eslint/js';
import { globalIgnores as globalIgnores$1, defineConfig } from 'eslint/config';
import stylistic from '@stylistic/eslint-plugin';
import json from '@eslint/json';
import globals from 'globals/globals.json' with { type: 'json' };
import tseslint from 'typescript-eslint';
// https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
// https://www.google.com/search?q=javascript+recurse+through+object+and+remove+undefined+properties
const globalIgnores = globalIgnores$1(['_tsout/**/*', '_tsout/*', '_tsout/', 'cjs/**/*', 'cjs/*/*', 'cjs/*', 'mjs/**/*', 'mjs/*', 'mjs/', 'node_modules/**/*', '**/node_modules/**/*', '**/*.tsbuildinfo', '**/bin/**/*', '**/obj/**/*', '.pnp.cjs', '.pnp.loader.mjs', '.yarn/sdks/**']);
const stylisticWarn = stylistic.configs.customize({
quoteProps: 'as-needed',
semi: true,
indent: 2,
severity: 'warn'
});
stylisticWarn.rules ??= {};
stylisticWarn.rules['@stylistic/no-extra-parens'] = ['warn', 'all', {
allowParensAfterCommentPattern: '@type|@satisfies',
nestedBinaryExpressions: false
}];
stylisticWarn.rules['@stylistic/semi'] = ['warn', 'always', {
omitLastInOneLineBlock: false,
omitLastInOneLineClassBody: false
}];
const config = defineConfig(_objectSpread(_objectSpread({}, json.configs.recommended), {}, {
name: 'JSON Recommended',
files: ['**/*.json'],
language: 'json/json'
}), {
name: 'JSON - Allow empty keys in package-lock.json',
files: ['**/package-lock.json'],
rules: {
'json/no-empty-keys': 'off'
}
}, _objectSpread(_objectSpread({}, json.configs.recommended), {}, {
name: 'JSONC Recommended',
files: ['**/*.jsonc'],
language: 'json/jsonc'
}), _objectSpread(_objectSpread({}, json.configs.recommended), {}, {
name: 'JSON5 Recommended',
files: ['**/*.json5'],
language: 'json/json5'
}), {
name: 'TSJS',
extends: [eslint.configs.recommended, ...tseslint.configs.strictTypeChecked, ...tseslint.configs.stylisticTypeChecked, stylisticWarn],
files: ['**/*.ts', '**/*.cts', '**/*.mts', '**/*.js', '**/*.cjs', '**/*.mjs', '**/*.jsx', '**/*.tsx'],
ignores: globalIgnores.ignores,
languageOptions: {
parserOptions: {
projectService: true
},
globals: globals.node
}
}, globalIgnores);
export { config as default };
//# sourceMappingURL=eslintConfig.mjs.map