Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
Suyashtnt committed Mar 25, 2024
1 parent a0f0a7e commit b49d032
Show file tree
Hide file tree
Showing 7 changed files with 4,021 additions and 2,086 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
permissions:
actions: read
contents: read

env:
NX_CLOUD_DISTRIBUTED_EXECUTION: true
NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT: 3 # expected number of agents
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:

- uses: nrwl/nx-set-shas@v3
with:
main-branch-name: 'dev'
main-branch-name: "dev"

# This line is needed for nx affected to work when CI is running on a PR
- name: Checkout default branch
Expand Down
224 changes: 113 additions & 111 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import js from '@eslint/js';
import nxPlugin from '@nx/eslint-plugin';
import typescriptPlugin from '@typescript-eslint/eslint-plugin';
import typescriptParser from '@typescript-eslint/parser';
import prettier from 'eslint-config-prettier';
import perfectionistNatural from 'eslint-plugin-perfectionist/configs/recommended-natural';
import prettierPlugin from 'eslint-plugin-prettier';
import sveltePlugin from 'eslint-plugin-svelte';
import jsoncParser from 'jsonc-eslint-parser';
import { join } from 'path';
import svelteParser from 'svelte-eslint-parser';
import { fileURLToPath } from 'url';
import js from "@eslint/js";
import nxPlugin from "@nx/eslint-plugin";
import typescriptPlugin from "@typescript-eslint/eslint-plugin";
import typescriptParser from "@typescript-eslint/parser";
import prettier from "eslint-config-prettier";
import perfectionistNatural from "eslint-plugin-perfectionist/configs/recommended-natural";
import prettierPlugin from "eslint-plugin-prettier";
import sveltePlugin from "eslint-plugin-svelte";
import jsoncParser from "jsonc-eslint-parser";
import { join } from "path";
import svelteParser from "svelte-eslint-parser";
import { fileURLToPath } from "url";

const prettierConfig = {
overrides: [
{
files: '*.svelte',
options: {
parser: 'svelte'
}
}
],
plugins: ['prettier-plugin-svelte'],
printWidth: 100,
singleQuote: true,
trailingComma: 'none',
useTabs: true
overrides: [
{
files: "*.svelte",
options: {
parser: "svelte",
},
},
],
plugins: ["prettier-plugin-svelte"],
printWidth: 100,
singleQuote: true,
trailingComma: "none",
useTabs: true,
};

/**
Expand All @@ -33,91 +33,93 @@ const prettierConfig = {
* @returns {import("eslint").Linter.FlatConfig[]}
*/
export function createConfig(tsconfigPath) {
return [
js.configs.recommended,
{
plugins: {
'@nx': nxPlugin,
'@typescript-eslint': typescriptPlugin
},
rules: {
...typescriptPlugin.configs.recommended.rules,
'@nx/enforce-module-boundaries': [
'error',
{
allow: [],
depConstraints: [
{
onlyDependOnLibsWithTags: ['*'],
sourceTag: '*'
}
],
enforceBuildableLibDependency: true
}
],
'arrow-body-style': 'off',
'no-undef': 'off',
'prefer-arrow-callback': 'off'
}
},
{
files: ['**/*.ts'],
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: 2020,
extraFileExtensions: ['.svelte'],
project: tsconfigPath,
sourceType: 'module'
}
}
},
{
files: ['**/*.svelte'],
languageOptions: {
parser: svelteParser,
parserOptions: {
parser: typescriptParser
}
},
plugins: {
// prettier: prettierPlugin,
svelte: sveltePlugin
},
processor: 'svelte/svelte',
rules: {
...sveltePlugin.configs.recommended.rules
// ...sveltePlugin.configs.prettier.rules,
}
},
{
files: ['*.json'],
languageOptions: {
parser: jsoncParser
},
plugins: {
'@nx': nxPlugin
},
rules: { '@nx/dependency-checks': 'error' }
},
{
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
plugins: {
prettier: prettierPlugin
},
rules: {
'prettier/prettier': [
'error',
prettierConfig,
{
usePrettierrc: false
}
]
}
},
perfectionistNatural,
prettier
];
return [
js.configs.recommended,
{
plugins: {
"@nx": nxPlugin,
"@typescript-eslint": typescriptPlugin,
},
rules: {
...typescriptPlugin.configs.recommended.rules,
"@nx/enforce-module-boundaries": [
"error",
{
allow: [],
depConstraints: [
{
onlyDependOnLibsWithTags: ["*"],
sourceTag: "*",
},
],
enforceBuildableLibDependency: true,
},
],
"arrow-body-style": "off",
"no-undef": "off",
"prefer-arrow-callback": "off",
},
},
{
files: ["**/*.ts"],
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: 2020,
extraFileExtensions: [".svelte"],
project: tsconfigPath,
sourceType: "module",
},
},
},
{
files: ["**/*.svelte"],
languageOptions: {
parser: svelteParser,
parserOptions: {
parser: typescriptParser,
},
},
plugins: {
// prettier: prettierPlugin,
svelte: sveltePlugin,
},
processor: "svelte/svelte",
rules: {
...sveltePlugin.configs.recommended.rules,
// ...sveltePlugin.configs.prettier.rules,
},
},
{
files: ["*.json"],
languageOptions: {
parser: jsoncParser,
},
plugins: {
"@nx": nxPlugin,
},
rules: { "@nx/dependency-checks": "error" },
},
{
files: ["*.ts", "*.tsx", "*.js", "*.jsx"],
plugins: {
prettier: prettierPlugin,
},
rules: {
"prettier/prettier": [
"error",
prettierConfig,
{
usePrettierrc: false,
},
],
},
},
perfectionistNatural,
prettier,
];
}

export default createConfig(join(fileURLToPath(import.meta.url), '..', 'tsconfig.base.json'));
export default createConfig(
join(fileURLToPath(import.meta.url), "..", "tsconfig.base.json"),
);
8 changes: 2 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 7 additions & 22 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"affected": {
"defaultBranch": "dev"
"defaultBranch": "dev"
},
"targetDefaults": {
"build": {
"dependsOn": [
"^build"
],
"inputs": [
"production",
"^production"
],
"dependsOn": ["^build"],
"inputs": ["production", "^production"],
"cache": true
},
"test": {
"inputs": [
"default",
"^default"
],
"inputs": ["default", "^default"],
"cache": true
},
"lint": {
Expand All @@ -34,9 +26,7 @@
"cache": true
}
},
"plugins": [
"@monodon/rust"
],
"plugins": ["@monodon/rust"],
"generators": {
"@nx/web:application": {
"style": "css",
Expand All @@ -46,13 +36,8 @@
}
},
"namedInputs": {
"default": [
"{projectRoot}/**/*",
"sharedGlobals"
],
"sharedGlobals": [
"{workspaceRoot}/.github/workflows/ci.yml"
],
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"sharedGlobals": ["{workspaceRoot}/.github/workflows/ci.yml"],
"production": [
"default",
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,3 @@
"tslib": "^2.6.2"
}
}

Loading

0 comments on commit b49d032

Please sign in to comment.