Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add prettier basic configuration #1309

Merged
merged 3 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 2 additions & 5 deletions .eslintrc-angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@
"*.ts"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@typescript-eslint/adjacent-overload-signatures": "warn", // TODO: remove this warning when refactoring unit tests.
"no-useless-escape": "warn", // TODO: remove this warning when refactoring unit tests.
"no-case-declarations": "warn", // TODO: remove this warning when refactoring unit tests.
"@typescript-eslint/adjacent-overload-signatures": "warn",

"@angular-eslint/directive-selector": [
"error",
{
Expand Down
192 changes: 178 additions & 14 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,193 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx", "ban"],
"ignorePatterns": [
"**/*"
],
"plugins": [
"@nrwl/nx",
"ban",
"unused-imports",
"simple-import-sort"
],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"files": [
"*.ts",
"*.tsx",
"*.js",
"*.jsx"
],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"warn", // TODO set to error later
"warn",
// TODO set to error later
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
"onlyDependOnLibsWithTags": [
"*"
]
}
]
}
]
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript", "eslint:recommended"],
"rules": {}
"files": [
"*.ts",
"*.tsx"
],
"excludedFiles": [
"*.spec.ts"
],
"extends": [
"airbnb-base",
"airbnb-typescript/base",
"plugin:@typescript-eslint/recommended",
"plugin:@nrwl/nx/typescript",
"eslint:recommended"
],
"rules": {
// ESLint rules
"array-bracket-spacing": "off",
"array-callback-return": "off",
"arrow-body-style": "off",
"arrow-parens": "off",
"curly": "off",
"default-case": "off",
"eqeqeq": "off",
"eol-last": "off",
"consistent-return": "off",
"function-paren-newline": "off",
"grouped-accessor-pairs": "off",
"import/prefer-default-export": "off",
"import/first": "off",
"import/newline-after-import": "off",
"import/no-cycle": "off",
"import/no-duplicates": "off",
"import/no-extraneous-dependencies": "off",
"import/no-useless-path-segments": "off",
"import/order": "off",
"implicit-arrow-linebreak": "off",
"key-spacing": "off",
"linebreak-style": "off",
"max-classes-per-file": "off",
"max-len": [
"off",
120
],
"new-parens": "off",
"no-confusing-arrow": "off",
"no-case-declarations": "warn",
"no-console": "off",
"no-else-return": "off",
"no-floating-decimal": "off",
"no-lonely-if": "off",
"no-multiple-empty-lines": "off",
"no-multi-spaces": "off",
"no-nested-ternary": "off",
"no-new": "off",
"no-param-reassign": "off",
"no-plusplus": "off",
"no-prototype-builtins": "off",
"no-redeclare": "off",
"no-restricted-globals": "off",
"no-restricted-properties": "off",
"no-restricted-syntax": "off",
"no-return-assign": "off",
"no-trailing-spaces": "off",
"no-undef": "off",
"no-undef-init": "off",
"no-underscore-dangle": "off",
"no-unneeded-ternary": "off",
"no-unreachable": "off",
"no-unsafe-optional-chaining": "off",
"no-unused-vars": "off",
"no-useless-rename": "off",
"no-useless-return": "off",
"no-useless-escape": "warn",
"nonblock-statement-body-position": "off",
"object-curly-newline": "off",
"object-shorthand": "off",
"operator-assignment": "off",
"operator-linebreak": "off",
"padded-blocks": "off",
"prefer-arrow-callback": "off",
"prefer-exponentiation-operator": "off",
"prefer-regex-literals": "off",
"prefer-template": "off",
"prefer-destructuring": "off",
"radix": "off",
"space-in-parens": "off",
"spaced-comment": "off",
"semi-spacing": "off",
"simple-import-sort/imports": "off",
"simple-import-sort/exports": "off",
"space-unary-ops": "off",
// eslint-plugin-unused-imports rules
"unused-imports/no-unused-imports": "off",
"unused-imports/no-unused-vars": [
"off",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_"
}
],
// TypeScript Eslint rules
"class-methods-use-this": "off",
"@typescript-eslint/comma-dangle": "off",
"@typescript-eslint/comma-spacing": "off",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/indent": "off",
"@typescript-eslint/brace-style": "off",
"@typescript-eslint/keyword-spacing": "off",
"@typescript-eslint/lines-between-class-members": "off",
"@typescript-eslint/quotes": [
"off",
"single"
],
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-shadow": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-redeclare": "off",
"@typescript-eslint/no-throw-literal": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-useless-constructor": "off",
"@typescript-eslint/object-curly-spacing": "off",
"@typescript-eslint/semi": "off",
"@typescript-eslint/space-before-blocks": "off",
"@typescript-eslint/space-infix-ops": "off"
},
"parserOptions": {
"project": "./tsconfig.eslint.json"
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"files": [
"*.js",
"*.jsx"
],
"extends": [
"plugin:@nrwl/nx/javascript"
],
"rules": {}
},
{
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
"files": [
"*.spec.ts",
"*.spec.tsx",
"*.spec.js",
"*.spec.jsx"
],
"env": {
"jest": true,
"jasmine": true
Expand All @@ -41,23 +196,32 @@
"ban/ban": [
2,
{
"name": ["describe", "only"],
"name": [
"describe",
"only"
],
"message": "don't focus tests"
},
{
"name": "fdescribe",
"message": "don't focus tests"
},
{
"name": ["it", "only"],
"name": [
"it",
"only"
],
"message": "don't focus tests"
},
{
"name": "fit",
"message": "don't focus tests"
},
{
"name": ["test", "only"],
"name": [
"test",
"only"
],
"message": "don't focus tests"
},
{
Expand Down
22 changes: 1 addition & 21 deletions libs/jdnconvertiblecalendar/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"no-unused-vars": "warn" // TODO remove later
}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {
"@typescript-eslint/no-namespace": "off",
"no-prototype-builtins": "off"
}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
"extends": ["../../.eslintrc-angular.json"]
}
22 changes: 1 addition & 21 deletions libs/jdnconvertiblecalendardateadapter/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-non-null-assertion": "warn",
"no-undef": "warn", // TODO remove later
"no-unused-vars": "warn" // TODO remove later
}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
"extends": ["../../.eslintrc-angular.json"]
}