You've already forked AstralRinth
forked from didirus/AstralRinth
feat: consistently format all HTML, XML, JSON, CSS, JS, TS, SQL, TOML, YAML, and Markdown files as far as possible (#4193)
* feat: consistently format all HTML, XML, JSON, CSS, JS, TS, SQL, TOML, YAML, and Markdown files * chore: deal with VS Code not being able to parse valid editorconfig syntax Sometimes I'm surprised that computers even work. * chore: get rid of IntelliJ IDE config files that should not be there These were already added to the `.gitignore` a long time ago, and now are being ignored by Prettier. * fix: rename `tooling-config` `format` script to `fix` for it to run with Turbo
This commit is contained in:
committed by
GitHub
parent
6f59f4c110
commit
1454e3351e
27
packages/tooling-config/app-lib.prettier.config.cjs
Normal file
27
packages/tooling-config/app-lib.prettier.config.cjs
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* @see https://prettier.io/docs/configuration
|
||||
* @type {import("prettier").Config}
|
||||
*/
|
||||
module.exports = {
|
||||
semi: false,
|
||||
singleQuote: true,
|
||||
plugins: ['prettier-plugin-toml', 'prettier-plugin-sql-cst', '@prettier/plugin-xml'],
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.sql'],
|
||||
options: {
|
||||
parser: 'sqlite',
|
||||
sqlAcceptUnsupportedGrammar: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['*.jsonc'],
|
||||
options: {
|
||||
parser: 'jsonc',
|
||||
// By spec, JSONC only extends JSON with comment support, not trailing commas as Prettier likes to add
|
||||
trailingComma: 'none',
|
||||
},
|
||||
},
|
||||
],
|
||||
xmlWhitespaceSensitivity: 'ignore',
|
||||
}
|
||||
@@ -3,18 +3,18 @@ import prettierEslint from 'eslint-plugin-prettier/recommended'
|
||||
import tseslint from 'typescript-eslint'
|
||||
|
||||
export default tseslint.config(
|
||||
eslint.configs.recommended,
|
||||
tseslint.configs.recommendedTypeChecked,
|
||||
prettierEslint,
|
||||
...common,
|
||||
{
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
warnOnUnsupportedTypeScriptVersion: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
ignores: ['node_modules/', 'dist/', 'build/'],
|
||||
},
|
||||
eslint.configs.recommended,
|
||||
tseslint.configs.recommendedTypeChecked,
|
||||
prettierEslint,
|
||||
...common,
|
||||
{
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
warnOnUnsupportedTypeScriptVersion: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
ignores: ['node_modules/', 'dist/', 'build/'],
|
||||
},
|
||||
)
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import simpleImportSort from 'eslint-plugin-simple-import-sort'
|
||||
|
||||
export default [
|
||||
{
|
||||
plugins: {
|
||||
'simple-import-sort': simpleImportSort,
|
||||
},
|
||||
rules: {
|
||||
'simple-import-sort/imports': 'error',
|
||||
'simple-import-sort/exports': 'error',
|
||||
},
|
||||
},
|
||||
{
|
||||
rules: {
|
||||
'@typescript-eslint/no-type-alias': 'off',
|
||||
'@typescript-eslint/ban-ts-comment': 'off',
|
||||
'@typescript-eslint/prefer-literal-enum-member': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
plugins: {
|
||||
'simple-import-sort': simpleImportSort,
|
||||
},
|
||||
rules: {
|
||||
'simple-import-sort/imports': 'error',
|
||||
'simple-import-sort/exports': 'error',
|
||||
},
|
||||
},
|
||||
{
|
||||
rules: {
|
||||
'@typescript-eslint/no-type-alias': 'off',
|
||||
'@typescript-eslint/ban-ts-comment': 'off',
|
||||
'@typescript-eslint/prefer-literal-enum-member': 'off',
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
@@ -4,28 +4,28 @@ import turboPlugin from 'eslint-plugin-turbo'
|
||||
import common from './common.mjs'
|
||||
|
||||
export const configurationNuxtToAppend = [
|
||||
...common,
|
||||
{
|
||||
name: 'turbo',
|
||||
plugins: {
|
||||
turbo: fixupPluginRules(turboPlugin),
|
||||
},
|
||||
rules: {
|
||||
'turbo/no-undeclared-env-vars': 'error',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'modrinth',
|
||||
rules: {
|
||||
'vue/html-self-closing': 'off',
|
||||
'vue/multi-word-component-names': 'off',
|
||||
},
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
warnOnUnsupportedTypeScriptVersion: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
...common,
|
||||
{
|
||||
name: 'turbo',
|
||||
plugins: {
|
||||
turbo: fixupPluginRules(turboPlugin),
|
||||
},
|
||||
rules: {
|
||||
'turbo/no-undeclared-env-vars': 'error',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'modrinth',
|
||||
rules: {
|
||||
'vue/html-self-closing': 'off',
|
||||
'vue/multi-word-component-names': 'off',
|
||||
},
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
warnOnUnsupportedTypeScriptVersion: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
export default createConfigForNuxt().append(configurationNuxtToAppend)
|
||||
|
||||
33
packages/tooling-config/frontend.prettier.config.cjs
Normal file
33
packages/tooling-config/frontend.prettier.config.cjs
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* @see https://prettier.io/docs/configuration
|
||||
* @type {import("prettier").Config}
|
||||
*/
|
||||
module.exports = {
|
||||
semi: false,
|
||||
singleQuote: true,
|
||||
plugins: [
|
||||
// In typical JS/TS britleness fashion, the Tailwind CSS plugin
|
||||
// has a transitive dependency on an import sort plugin that breaks
|
||||
// TypeScript type annotations, for reasons unbeknownst to anyone.
|
||||
// Our frontend project was the only one enabling such plugin, so
|
||||
// to avoid this bug spreading to other parts of the monorepo, let's
|
||||
// keep it contained to it. See:
|
||||
// https://github.com/tailwindlabs/prettier-plugin-tailwindcss/issues/338
|
||||
// https://github.com/prettier/prettier-vscode/issues/3578
|
||||
'prettier-plugin-tailwindcss',
|
||||
'prettier-plugin-toml',
|
||||
'prettier-plugin-sql-cst',
|
||||
'@prettier/plugin-xml',
|
||||
],
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.jsonc'],
|
||||
options: {
|
||||
parser: 'jsonc',
|
||||
// By spec, JSONC only extends JSON with comment support, not trailing commas as Prettier likes to add
|
||||
trailingComma: 'none',
|
||||
},
|
||||
},
|
||||
],
|
||||
xmlWhitespaceSensitivity: 'ignore',
|
||||
}
|
||||
27
packages/tooling-config/labrinth.prettier.config.cjs
Normal file
27
packages/tooling-config/labrinth.prettier.config.cjs
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* @see https://prettier.io/docs/configuration
|
||||
* @type {import("prettier").Config}
|
||||
*/
|
||||
module.exports = {
|
||||
semi: false,
|
||||
singleQuote: true,
|
||||
plugins: ['prettier-plugin-toml', 'prettier-plugin-sql-cst', '@prettier/plugin-xml'],
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.sql'],
|
||||
options: {
|
||||
parser: 'postgresql',
|
||||
sqlAcceptUnsupportedGrammar: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['*.jsonc'],
|
||||
options: {
|
||||
parser: 'jsonc',
|
||||
// By spec, JSONC only extends JSON with comment support, not trailing commas as Prettier likes to add
|
||||
trailingComma: 'none',
|
||||
},
|
||||
},
|
||||
],
|
||||
xmlWhitespaceSensitivity: 'ignore',
|
||||
}
|
||||
@@ -1,35 +1,44 @@
|
||||
{
|
||||
"name": "@modrinth/tooling-config",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"description": "Unified tooling configuration for Modrinth monorepo",
|
||||
"main": "./index.js",
|
||||
"exports": {
|
||||
"./eslint/*": "./eslint/*",
|
||||
"./typescript/*": "./typescript/*",
|
||||
"./prettier.config.js": "./prettier.config.js",
|
||||
"./prettier.nuxt.config.js": "./prettier.nuxt.config.js"
|
||||
},
|
||||
"files": [
|
||||
"eslint/",
|
||||
"typescript/",
|
||||
"prettier/",
|
||||
"index.js"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"eslint": "^9.31.0",
|
||||
"prettier": "^3.6.2",
|
||||
"typescript": ">=5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.32.0",
|
||||
"@vue/tsconfig": "^0.7.0",
|
||||
"eslint": "^9.32.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-prettier": "^5.5.3",
|
||||
"eslint-plugin-simple-import-sort": "^12.1.1",
|
||||
"eslint-plugin-vue": "^10.4.0",
|
||||
"globals": "^16.3.0",
|
||||
"typescript-eslint": "^8.38.0"
|
||||
}
|
||||
"name": "@modrinth/tooling-config",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"description": "Unified tooling configuration for Modrinth monorepo",
|
||||
"main": "./index.js",
|
||||
"scripts": {
|
||||
"lint": "prettier --check .",
|
||||
"fix": "prettier --write ."
|
||||
},
|
||||
"exports": {
|
||||
"./eslint/*": "./eslint/*",
|
||||
"./typescript/*": "./typescript/*",
|
||||
"./prettier.config.cjs": "./prettier.config.cjs",
|
||||
"./frontend.prettier.config.cjs": "./frontend.prettier.config.cjs",
|
||||
"./app-lib.prettier.config.cjs": "./app-lib.prettier.config.cjs",
|
||||
"./labrinth.prettier.config.cjs": "./labrinth.prettier.config.cjs"
|
||||
},
|
||||
"files": [
|
||||
"eslint/",
|
||||
"typescript/",
|
||||
"prettier/",
|
||||
"index.js"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"eslint": "^9.31.0",
|
||||
"prettier": "^3.6.2",
|
||||
"typescript": ">=5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.32.0",
|
||||
"@prettier/plugin-xml": "^3.4.2",
|
||||
"@vue/tsconfig": "^0.7.0",
|
||||
"eslint": "^9.32.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-prettier": "^5.5.3",
|
||||
"eslint-plugin-simple-import-sort": "^12.1.1",
|
||||
"eslint-plugin-vue": "^10.4.0",
|
||||
"globals": "^16.3.0",
|
||||
"prettier-plugin-sql-cst": "^0.13.0",
|
||||
"prettier-plugin-toml": "^2.0.6",
|
||||
"typescript-eslint": "^8.38.0"
|
||||
}
|
||||
}
|
||||
|
||||
20
packages/tooling-config/prettier.config.cjs
Normal file
20
packages/tooling-config/prettier.config.cjs
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* @see https://prettier.io/docs/configuration
|
||||
* @type {import("prettier").Config}
|
||||
*/
|
||||
module.exports = {
|
||||
semi: false,
|
||||
singleQuote: true,
|
||||
plugins: ['prettier-plugin-toml', 'prettier-plugin-sql-cst', '@prettier/plugin-xml'],
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.jsonc'],
|
||||
options: {
|
||||
parser: 'jsonc',
|
||||
// By spec, JSONC only extends JSON with comment support, not trailing commas as Prettier likes to add
|
||||
trailingComma: 'none',
|
||||
},
|
||||
},
|
||||
],
|
||||
xmlWhitespaceSensitivity: 'ignore',
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
/**
|
||||
* @see https://prettier.io/docs/configuration
|
||||
* @type {import("prettier").Config}
|
||||
*/
|
||||
const config = {
|
||||
semi: false,
|
||||
singleQuote: true,
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
@@ -1,11 +0,0 @@
|
||||
/**
|
||||
* @see https://prettier.io/docs/configuration
|
||||
* @type {import("prettier").Config}
|
||||
*/
|
||||
const config = {
|
||||
semi: false,
|
||||
singleQuote: true,
|
||||
plugins: ["prettier-plugin-tailwindcss"]
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"lib": ["esnext", "dom"],
|
||||
"allowSyntheticDefaultImports": true
|
||||
}
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"lib": ["esnext", "dom"],
|
||||
"allowSyntheticDefaultImports": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
||||
"compilerOptions": {
|
||||
"lib": ["ESNext", "DOM"],
|
||||
"moduleResolution": "bundler",
|
||||
"noImplicitAny": false
|
||||
}
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
||||
"compilerOptions": {
|
||||
"lib": ["ESNext", "DOM"],
|
||||
"moduleResolution": "bundler",
|
||||
"noImplicitAny": false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user