
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
ng-config-files
Advanced tools
Offers a standardized set of configuration files tailored specifically for Angular libraries and applications
Offers a standardized set of configuration files tailored specifically for Angular libraries and applications
ng-config-files should be included as a dependency in your npm project.
It will install the necessary linters and checkers for your project:
It additionally offers configuration files that can be referenced using the appropriate command, such as "extends", in the configuration file.
manually copied to the root of your project.
All of these files are stored within the config folder.
This file is utilized to enforce basic rules regarding indentation, trailing whitespaces, and linefeeds in most Integrated Development Environments (IDEs). In certain IDEs or editors, such as VS Code, you may need to install an extension like "EditorConfig for VS Code" (editorconfig.editorconfig). It's highly recommended to install such plugins or extensions in your preferred IDE or editor.
Copy the file into the root directory of your project
Introducing a fresh configuration file for ESLint, equipped with TypeScript support via TypeScript ESLint and Angular-specific configurations from Angular ESLint.
You can customize and apply this file to your project:
ng) with the one used in your project, as declared in your angular.json file under project.xxx.prefix.ignorePatterns array. ESLint will throw errors if it encounters a file not covered by the tsconfig files.overrides section divides the options, particularly the rules, between JavaScript, TypeScript (with or without Angular), and HTML files.project array, list the tsconfig files that define the paths to the code to be linted.extends array, specify the configuration files to use for linting your project:
'eslint:recommended' for base ESLint rules.'plugin:@typescript-eslint/recommended' for base TypeScript rules.'plugin:@typescript-eslint/recommended-requiring-type-checking' for more advanced TypeScript rules.eslintrc.plugins.js defines the plugin configurations (recommended settings and overrides), including angular-eslint configurations.eslintrc.semantics.es.js defines ES rules for coding best practices.eslintrc.semantics.ts.js extends the ES rules for TypeScript coding best practices.eslintrc.style.es.js defines fixable ES rules for code formatting.eslintrc.style.ts.js extends the ES rules for TypeScript code formatting.eslintrc.html.js defines rules for Angular templates.eslintrc.stricter.js contains recommended rules that have been deactivated to remain compatible with existing codebases. You can activate them on new projects or selectively include them in your project's settings.eslintrc.demo.js deactivates some rules to be more lenient in demo projects (typically deactivated rules like no-magic-number, no-console, etc.). It can also be used for unit tests.rules section, you can activate or deactivate rules to suit your project's needs.Note: If you have a monorepo with multiple projects, each with its own tsconfig, you can place the generic .eslintrc.js file at the top-level and have similar files in each sub-project, overriding the generic one. For instance, in our libraries, there is a generic file for each library and a custom one within the demo_files sub-project, allowing for the definition of specific tsconfig settings and custom rules.
You also need to add or modify the lint section of each project in your angular.json file (located within the architect section) to resemble the following structure:
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.{ts,html}"
]
}
}
This configuration ensures that the linting process is performed correctly for TypeScript and HTML files within the specified directory patterns.
Adjust the lintFilePatterns array as needed to match the directory structure of your project(excluding those specified in the ignorePatterns setting).
If your project has multiple roots, as defined in the tsconfig file, you need to list them all in the lintFilePatterns array. Ensure that the patterns cover all the files intended for linting across these multiple roots.
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.{ts,html}",
"common/**/*.{ts,html}",
"choice/**/*.{ts,html}",
"errors/**/*.{ts,html}",
[...]
"text/**/*.{ts,html}"
]
}
}
corresponding to the following tsconfig section:
"files": [
"src/index.ts",
"common/index.ts",
"choice/index.ts",
"errors/index.ts",
[...]
"text/index.ts",
],
If you have Jest tests, you can utilize the provided eslint-plugin-jest plugin. No rules have been included here, as the plugin may raise complaints if the project does not utilize Jest
You need to manually add recommended rules and corresponding overrides. Refer to the sample .eslintrc.js file for guidance
We suggest utilizing the Microsoft ESLint extension for Visual Studio Code (identified as dbaeumer.vscode-eslint).
You can insert the following lines into your settings.json file (accessible through Ctrl+Shift+P > Preferences: Open Settings (JSON)):
"eslint.options": {
"extensions": [".js", ".ts", ".html"]
},
"eslint.alwaysShowStatus": true,
A foundational file to be duplicated into the root directory of your project, and tailored as necessary.
A directory to be copied to the root of your project, facilitating Husky.\ integration.
It contains scripts that trigger commitlint and lint-staged.
You need to include the following lines in your package.json:
"scripts": {
[...]
"prepare": "husky install"
},
"lint-staged": {
"*.scss": [
"stylelint"
],
"*.ts": [
"eslint --no-ignore --max-warnings 0"
],
"*.html": [
"eslint --max-warnings 0"
]
},
The max-warnings option halts the commit process if ESLint warnings are issued, not just for errors. Alerts such as incorrect indentation or missing semicolons are flagged as warnings to avoid excessive noise, but they still halt the commit and require resolution.
Note: If you exclude files in ESLint's ignorePatterns configuration and make changes to them (typically at the top-level of the project), ESLint will issue a warning, thus halting the commit.
In such cases, after addressing other issues, temporarily remove the ESLint-related settings (without committing package.json!), to circumvent the problem, and then restore them immediately after."
Configuration file for Stylelint.
To incorporate it into your project, install ng-config-files as an npm dependency, then simply place the .stylelintrc file as it is in your project directory.
We suggest utilizing the official Stylelint extension for Visual Studio Code (identified as stylelint.vscode-stylelint).
You can insert the following lines into your settings.json file (accessible via Ctrl+Shift+P > Preferences: Open Settings (JSON)):
"css.validate": false,
"scss.validate": false,
"stylelint.validate": ["css", "scss"],
Configuration file for TypeScript and Angular compilation.
To incorporate it into your project, install ng-config-files as an npm dependency, and then reference this file from your main tsconfig.*.json file:
{
"extends": "./node_modules/ng-config-files/configs/tsconfig.json",
"compilerOptions": {
// Options specific to your project
},
"angularCompilerOptions": {
// Options specific to your project, maybe relaxing strict checks
}
}
This is a deprecated configuration file for ESLint, pointing to the eslint-old folder
This is a deprecated configuration file for TSLint.
Instead, use .eslintrc.js.
This project necessitates Node.js 20.x+.
# clone the repository
git clone git@github.com:ahmedbhl/ng-config-files.git
# install dependencies
cd ng-config-files
npm ci
Unlike other frontend libraries, this project does not have a CI process and is not automatically published upon a new version. To release a new version:
npm version [major|minor|patch] as usual. The tag is also pushed.npm publish.FAQs
Offers a standardized set of configuration files tailored specifically for Angular libraries and applications
We found that ng-config-files demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.