Skip to content

Commit

Permalink
Running prettier on config files.
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-bizz committed Nov 21, 2024
1 parent a32b9af commit 4518aa8
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"naumovs.color-highlight",
"streetsidesoftware.code-spell-checker",
"streetsidesoftware.code-spell-checker"
]
}
4 changes: 0 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
"eslint.validate": ["javascript", "typescript", "html"],
"editor.formatOnSave": true,
"typescript.tsdk": "node_modules/typescript/lib",
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"eslint.nodePath": "node_modules",
"prettier.prettierPath": "./node_modules/prettier",
"typescript.enablePromptUseWorkspaceTsdk": true,
Expand Down
28 changes: 7 additions & 21 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,8 @@
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/assets/img",
"src/assets/sitemap.txt"
],
"styles": [
"src/styles.css"
],
"assets": ["src/assets/img", "src/assets/sitemap.txt"],
"styles": ["src/styles.css"],
"scripts": [],
"vendorChunk": true,
"extractLicenses": false,
Expand Down Expand Up @@ -106,23 +101,16 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.cjs",
"styles": ["src/styles.css"],
"scripts": [],
"assets": [
"src/assets"
]
"assets": ["src/assets"]
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
"tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"],
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
}
}
}
Expand Down Expand Up @@ -151,9 +139,7 @@
},
"defaultProject": "knowgod",
"cli": {
"schematicCollections": [
"@angular-eslint/schematics"
],
"schematicCollections": ["@angular-eslint/schematics"],
"analytics": false
}
}
60 changes: 26 additions & 34 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,31 @@ import eslintPluginPrettier from 'eslint-plugin-prettier';

export default [
{
ignores: [
'.github',
'.angular',
'*package.json',
'yarn.lock',
'dist/**',
'karma.conf.cjs',
'commitlint.config.js*',
],
ignores: ['dist/**']
},
{
files: ['**/*.ts'],
languageOptions: {
parser: typescriptParser,
parserOptions: {
project: [path.resolve('tsconfig.json')],
createDefaultProgram: true,
},
createDefaultProgram: true
}
},
plugins: {
'@angular-eslint': angularEslintPlugin,
import: eslintPluginImport,
'@typescript-eslint': typescriptEslintPlugin,
prettier: eslintPluginPrettier,
prettier: eslintPluginPrettier
},
settings: {
'import/resolver': {
node: {
// Allows to import url starting from 'src'
paths: ['.'],
extensions: ['.js', '.ts', '.d.ts'],
},
},
extensions: ['.js', '.ts', '.d.ts']
}
}
},

rules: {
Expand All @@ -55,21 +47,21 @@ export default [
{
prefix: 'app',
style: 'kebab-case',
type: 'element',
},
type: 'element'
}
],
'@angular-eslint/directive-selector': [
'error',
{
prefix: 'app',
style: 'camelCase',
type: 'attribute',
},
type: 'attribute'
}
],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' }
],
'import/no-duplicates': 'error',
'import/extensions': 'error',
Expand All @@ -84,23 +76,23 @@ export default [
'sibling',
'index',
'object',
'type',
'type'
],
alphabetize: { order: 'asc' },
'newlines-between': 'never',
pathGroups: [
{
pattern: '{@angular,angular/**}',
group: 'external',
position: 'before',
position: 'before'
},
{
pattern: '{src}/**',
group: 'parent',
position: 'before',
},
],
},
position: 'before'
}
]
}
],
'import/newline-after-import': 'error',
'import/no-named-default': 'error',
Expand All @@ -112,18 +104,18 @@ export default [
'error',
{
ignoreDeclarationSort: true,
ignoreMemberSort: false,
},
],
},
ignoreMemberSort: false
}
]
}
},
{
files: ['*.html'],
plugins: {
'@angular-eslint/template': angularEslintTemplatePlugin,
'@angular-eslint/template': angularEslintTemplatePlugin
},
rules: {
...angularEslintTemplatePlugin.configs.recommended.rules,
},
},
...angularEslintTemplatePlugin.configs.recommended.rules
}
}
];
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "ng build --configuration production",
"build:dev": "ng build --configuration development",
"test": "ng test --watch=false",
"lint": "npx eslint 'src/**/*.{js,ts,html}' --fix",
"lint": "eslint 'src/**/*.{js,ts,html}' --fix",
"prettier:check": "prettier '{{src,embed}/**/*.{js,json,ts,tsx,html},./*.{js,json,ts,tsx,yml,html}}' --list-different",
"prettier:write": "prettier '{{src,embed}/**/*.{js,json,ts,tsx,html},./*.{js,json,ts,tsx,yml,html}}' --write",
"precommit": "pretty-quick --staged",
Expand Down
6 changes: 1 addition & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
"experimentalDecorators": true,
"target": "ES2022",
"typeRoots": ["node_modules/@types"],
"lib": ["es2017", "dom"],
"paths": {
"@angular/*": ["node_modules/@angular/*"],
"src/*": ["src/*"]
}
"lib": ["es2017", "dom"]
}
}

0 comments on commit 4518aa8

Please sign in to comment.