Skip to content

Commit

Permalink
chore: remove remark config, eslint mdx and eslint toml
Browse files Browse the repository at this point in the history
  • Loading branch information
rellafella committed Feb 24, 2025
1 parent 26e89a1 commit 765640f
Show file tree
Hide file tree
Showing 43 changed files with 79 additions and 1,862 deletions.
1 change: 0 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=*knip*
public-hoist-pattern[]=*mdat*
public-hoist-pattern[]=*prettier*
public-hoist-pattern[]=*remark*
public-hoist-pattern[]=*stylelint*
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ pnpm-lock.yaml
package-lock.json

# Customizations
bin/
/test/fixtures/input/
/test/fixtures/output-fixed-auto/
3 changes: 0 additions & 3 deletions .remarkrc.js

This file was deleted.

4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"json5",
"jsonc",
"markdown",
"mdx",
"svelte",
"toml",
"typescript",
Expand Down Expand Up @@ -66,5 +67,6 @@
"**/.prettierignore",
"**/*.svelte"
],
"prettier.enable": true
"prettier.enable": true,
"references.preferredLocation": "view"
}
1 change: 0 additions & 1 deletion knip.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export default knipConfig({
'mdat',
'prettier-plugin-packagejson',
'prettier-plugin-sh',
'prettier-plugin-toml',
'prettier-plugin-yaml',
'prettier-plugin-tailwindcss',
'prettier-plugin-svelte',
Expand Down
1 change: 0 additions & 1 deletion packages/cspell-config/dictionaries/envsa-files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ cjpeg
dfont
flac
gif
remarkrc
1 change: 0 additions & 1 deletion packages/cspell-config/dictionaries/envsa-misc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ redactorcustomstyles
relatedsub
rella
rellafella
remarklint
renmark
renxt
retcon
Expand Down
3 changes: 0 additions & 3 deletions packages/eslint-config/.vscode/extensions.json

This file was deleted.

26 changes: 0 additions & 26 deletions packages/eslint-config/.vscode/settings.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/eslint-config/init/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"eslint.enable": true,
"eslint.runtime": "node",
"eslint.validate": [
"astro",
"html",
"javascript",
"json",
"json5",
"jsonc",
"markdown",
"mdx",
"svelte",
"toml",
"typescript",
Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"eslint-plugin-no-only-tests": "^3.3.0",
"eslint-plugin-package-json": "^0.26.0",
"eslint-plugin-svelte": "^2.46.1",
"eslint-plugin-toml": "^0.12.0",
"eslint-plugin-unicorn": "^56.0.1",
"eslint-plugin-yml": "^1.16.0",
"execa": "^9.5.2",
Expand All @@ -74,7 +73,6 @@
"prettier": "^3.5.0",
"sort-package-json": "^2.14.0",
"svelte-eslint-parser": "^0.43.0",
"toml-eslint-parser": "^0.10.0",
"yaml-eslint-parser": "^1.2.3"
},
"devDependencies": {
Expand Down
17 changes: 2 additions & 15 deletions packages/eslint-config/scripts/typegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,7 @@
import { flatConfigsToRulesDTS } from 'eslint-typegen/core';
import { builtinRules } from 'eslint/use-at-your-own-risk';
import fs from 'node:fs/promises';
import {
combine,
disables,
html,
ignores,
js,
json,
md,
svelte,
test,
toml,
ts,
yaml,
} from '../src';
import { combine, disables, html, ignores, js, json, md, svelte, test, ts, yaml } from '../src';

const configs = await combine(
{
Expand All @@ -33,13 +20,13 @@ const configs = await combine(
md(),
svelte(),
test(),
toml(),
ts(),
yaml(),
);

const configNames = configs.map((index) => index.name).filter(Boolean) as string[];

console.log(configNames);
let dts = await flatConfigsToRulesDTS(configs, {
includeAugmentation: false,
});
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config/src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ export const commandDefinition: CommandDefinition = {
positionalArgumentMode: 'optional',
},
},
description: `Envsa's ESLint shared configuration tools.`,
description: "Envsa's ESLint shared configuration tools.",
logColor: 'magenta',
logPrefix: '[ESLint]',
logPrefix: `[ESLint]`,
name: 'envsa-eslint',
order: 4,
};
2 changes: 1 addition & 1 deletion packages/eslint-config/src/configs/disables.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { prettierRules } from '../presets/prettier';
import type { Rules, TypedFlatConfigItem } from '../types';
import { prettierRules } from '../presets/prettier';

/**
* Final configuration pass to disable specific rules in specific contexts.
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config/src/configs/ignores.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GLOB_EXCLUDE } from '../globs';
import type { TypedFlatConfigItem } from '../types';
import { GLOB_EXCLUDE } from '../globs';

export async function ignores(userIgnores: string[] = []): Promise<TypedFlatConfigItem[]> {
return [
Expand Down
1 change: 0 additions & 1 deletion packages/eslint-config/src/configs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ export * from './md';
export * from './shared-js-ts';
export * from './svelte';
export * from './test';
export * from './toml';
export * from './ts';
export * from './yaml';
1 change: 0 additions & 1 deletion packages/eslint-config/src/configs/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export async function json(options: OptionsOverrides = {}): Promise<TypedFlatCon
'knip',
'mdat',
'prettier',
'remarkConfig',
'stylelint',
]),
},
Expand Down
35 changes: 0 additions & 35 deletions packages/eslint-config/src/configs/toml.ts

This file was deleted.

27 changes: 13 additions & 14 deletions packages/eslint-config/src/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import type { Linter } from 'eslint';
import { FlatConfigComposer } from 'eslint-flat-config-utils';
import globals from 'globals';
import { isPackageExists } from 'local-pkg';
import { disables, html, ignores, js, json, md, svelte, test, toml, ts, yaml } from './configs';
import { tsParser } from './parsers';
import type { RuleOptions } from './typegen';
import type { Awaitable, ConfigNames, OptionsConfig, TypedFlatConfigItem } from './types';
import { interopDefault, isInEditorEnvironment } from './utils';
import { disables, html, ignores, js, json, md, svelte, test, ts, yaml } from './configs';
import { tsParser } from './parsers';
import { interopDefault, isInEditorEnv as isInEditorEnvironment } from './utils';

const flatConfigProperties = [
'name',
Expand All @@ -34,10 +34,9 @@ export const defaultPluginRenaming = {
export type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;

/**
* Construct an array of ESLint flat config items
* Construct an array of ESLint flat config items.
* @param options The options for generating the ESLint configurations.
* @param userConfigs The user configurations to be merged with the generated configurations.
* @returns The merged ESLint configurations.
*/
export async function eslintConfig(
options: Omit<TypedFlatConfigItem, 'files'> & OptionsConfig = {},
Expand All @@ -54,9 +53,8 @@ export async function eslintConfig(
let { isInEditor } = options;
if (isInEditor === undefined) {
isInEditor = isInEditorEnvironment();
if (isInEditor) {
if (isInEditor)
console.log('[@envsa/eslint-config] Detected running in editor, some rules are disabled.');
}
}

const configs: Array<Awaitable<TypedFlatConfigItem[]>> = [];
Expand All @@ -65,7 +63,10 @@ export async function eslintConfig(
if (typeof enableGitignore === 'boolean') {
configs.push(
interopDefault(import('eslint-config-flat-gitignore')).then((r) => [
r({ name: 'envsa/gitignore', strict: false }),
r({
name: 'envsa/gitignore',
strict: false,
}),
]),
);
} else {
Expand Down Expand Up @@ -116,9 +117,6 @@ export async function eslintConfig(
yaml({
overrides: getOverrides(options, 'yaml'),
}),
toml({
overrides: getOverrides(options, 'toml'),
}),
md({
overrides: getOverrides(options, 'md'),
overridesEmbeddedScripts: getOverridesEmbeddedScripts(options, 'md'),
Expand Down Expand Up @@ -148,9 +146,10 @@ export async function eslintConfig(
}

// User can optionally pass a flat config item to the first argument
// We pick the known keys as ESLint would do schema validation
// We pick the known keys as ESLint would do schema validation

const fusedConfig = flatConfigProperties.reduce<TypedFlatConfigItem>((accumulator, key) => {
// eslint-disable-next-line ts/no-unsafe-assignment, ts/no-explicit-any
// eslint-disable-next-line ts/no-explicit-any, ts/no-unsafe-assignment
if (key in options) accumulator[key] = options[key] as any;
return accumulator;
}, {});
Expand All @@ -175,7 +174,7 @@ export async function eslintConfig(

// console.log(plugins)

// eslint-disable-next-line ts/no-explicit-any, ts/no-unsafe-argument
// eslint-disable-next-line ts/no-unsafe-argument, ts/no-explicit-any
composer = composer.append(...configs, ...(userConfigs as any));

composer = composer.renamePlugins(defaultPluginRenaming);
Expand Down
12 changes: 6 additions & 6 deletions packages/eslint-config/src/globs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const GLOB_SRC_EXT = '?([cm][jt]s)';
export const GLOB_SRC_EXT = '?([cm])[jt]s';
export const GLOB_SRC = `**/*.${GLOB_SRC_EXT}`;

export const GLOB_JS = '**/*.?([cm])js';
Expand All @@ -19,7 +19,6 @@ export const GLOB_MARKDOWN = '**/*.md';

export const GLOB_SVELTE = '**/*.svelte';
export const GLOB_YAML = '**/*.y?(a)ml';
export const GLOB_TOML = '**/*.toml';
export const GLOB_XML = '**/*.xml';
export const GLOB_SVG = '**/*.svg';
export const GLOB_HTML = '**/*.{htm?(l),twig}';
Expand Down Expand Up @@ -50,17 +49,18 @@ export const GLOB_ALL_SRC = [
export const GLOB_EXCLUDE = [
'**/node_modules',
'**/dist',
'**/web/assets',
'**/package-lock.json',
'**/yarn-lock',
'**/yarn-lock.yaml',
'**/yarn.lock',
'**/pnpm-lock.yaml',
'**/bun.lockb',
'**/bin',

'**/output',
'**/coverage',
'**/temp',
'**/.temp',
'**/tmp',
'**/.tmp',
'**/.history',
'**/.vitepress/cache',
'**/.svelte-kit',
Expand All @@ -71,7 +71,7 @@ export const GLOB_EXCLUDE = [
'**/.output',
'**/.vite-inspect',
'**/.yarn',
'**/vite.config/*.timestamp-*',
'**/vite.config.*.timestamp-*',

'**/CHANGELOG*.md',
'**/*.min.*',
Expand Down
1 change: 0 additions & 1 deletion packages/eslint-config/src/presets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export * from './node';
export * from './prettier';
export * from './svelte';
export * from './test';
export * from './toml';
export * from './unicorn';
export * from './xo';
export * from './yaml';
10 changes: 0 additions & 10 deletions packages/eslint-config/src/presets/toml.ts

This file was deleted.

Loading

0 comments on commit 765640f

Please sign in to comment.