angular-eslint
rushstack
angular-eslint | rushstack | |
---|---|---|
22 | 11 | |
1,563 | 5,599 | |
0.6% | 0.6% | |
9.4 | 10.0 | |
5 days ago | 6 days ago | |
TypeScript | TypeScript | |
MIT License | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
angular-eslint
-
Lint rule for self-closing tags in Angular
Until I recently discovered that angular-eslint had added a new lint rule in v16.2 called prefer-self-closing-tags that can be used to enforce this syntax partially or throughout a project.
- How to create service call to get users
-
Angular 16 Unveiled: Discover the Top 7 Features
We are also using angular-eslint which now supports 16.0.3 so that was painless.
-
Angular Universal SSR ESLint rules?
Along the lines of Angular ESLint, are there any packages that provide ESLint rules around writing SSR friendly code?
-
npx storybook init does not work properly? It installs react and react-dom, also the components are full of errors?! Am I doing something wrong?
{ "root": true, "ignorePatterns": ["projects/**/*"], "rules": { "prettier/prettier": [ "error", { "endOfLine": "auto" } ] }, "overrides": [ { // TODO: find a way to apply rules on all files ending with .ts except for files ending with .stories.ts "files": ["*.ts"], "extends": [ "eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:@angular-eslint/recommended", "plugin:@angular-eslint/template/process-inline-templates", "plugin:prettier/recommended" ], "rules": { // https://github.com/angular-eslint/angular-eslint/tree/main/packages/eslint-plugin/docs/rules "@angular-eslint/directive-selector": [ "error", { "type": "attribute", "prefix": "hv", "style": "camelCase" } ], "@angular-eslint/component-selector": [ "error", { "type": "element", "prefix": "hv", "style": "kebab-case" } ], // https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules "@typescript-eslint/member-ordering": "error", "@typescript-eslint/naming-convention": "error", // https://eslint.org/docs/latest/rules/ "default-case": "error", "default-case-last": "error" } }, { "files": ["*.html"], "extends": [ "plugin:@angular-eslint/template/recommended", "plugin:prettier/recommended" ], "rules": { // https://github.com/angular-eslint/angular-eslint/tree/main/packages/eslint-plugin-template/docs/rules "@angular-eslint/template/no-duplicate-attributes": ["error"], "@angular-eslint/template/attributes-order": ["error"], "@angular-eslint/template/no-call-expression": [ "error" ], "@angular-eslint/template/accessibility-elements-content": [ "error", { "allowList": [ "ariaLabel" ] } ], "@angular-eslint/template/accessibility-valid-aria": [ "error" ] } }, { "files": ["*.stories.@(ts|mjs|cjs)"], "extends": ["plugin:storybook/recommended"] // https://github.com/storybookjs/eslint-plugin-storybook/tree/main/docs/rules // "rules": {} } ] }
-
Personal Angular Best Practices
I don't think it's crazy, but these things improved my code quality a lot: * Use Prettier, an opinionated code formatter. It formats your code, no configuration, no fights with your colleagues. * Use eslint and SonarLint. They help you find bugs before you even commit your code. * Try to achieve a very high code coverage. Not every line needs to be covered, but I personally feel better if I've got 90+% coverage. It's not that hard once you include it in your coding-DNA. * Setup your IDE to properly debug your code. Don't do console.log(), use debugger; statements or real conditional breakpoints. Nothing sucks more than not being able to find out what your code really does. * Learn the ES6 and later features. Many developers tend to code in old ways (as they are used to), but JavaScript can do so much more these days. You'll save a lot of time and effort applying these new features. Start with Arrow Functions, followed by Rest and Spread operator, Property Shorthand and * Destructuring . Also note that there are some awesome new datastructures like Map and Set. * Learn TypeScript and keep yourself up to date. There are so many anti-patterns (never ever use any) that degregate your fancy, strictly typed highlevel code to buggy ES-code. It also helps a lot to reduce DRY and boilerplate. * Learn rxjs and use it on a daily base. Angular itself is really reactive as most Angular services return Observables that can be further processed with rxjs. Once your mind made the switch, you won't really use regular Events and/or loops anymore. But be aware of how to properly test your rxjs pipelines. * If you are integrating a remote API, I have very good experiences with OpenAPI and it's code generator for Angular. You will get ready-to-use interfaces and services just from an OpenAPI specification (which you get as a gift for many of the modern backend frameworks). Saves a lot of time and boilerplate code and removes the need to test and debug API-layer code. Your build will break as soon as the API introduces a breaking change, which is exactly what you want (it's too late if your app breaks on production)
-
Angular ESLint Rules for Keyboard Accessibility
If you're not already using Angular ESLint, you can add it to an Angular project by running the schematic:
-
Adding the ESLint to an Angular application
ng add @angular-eslint/schematics ℹ Using package manager: npm ✔ Found compatible package version: @angular-eslint/[email protected]. ✔ Package information loaded. The package @angular-eslint/[email protected] will be installed and executed. Would you like to proceed? Yes ✔ Packages successfully installed. All @angular-eslint dependencies have been successfully installed 🎉 Please see https://github.com/angular-eslint/angular-eslint for how to add ESLint configuration to your project. We detected that you have a single project in your workspace and no existing linter wired up, so we are configuring ESLint for you automatically. Please see https://github.com/angular-eslint/angular-eslint for more information. CREATE .eslintrc.json (984 bytes) UPDATE package.json (1511 bytes) UPDATE angular.json (3447 bytes) ✔ Packages installed successfully.
-
Getting started with Husky and Lint-staged for pre-commit hooks
We need two tools to get the job done. The first tool that we need is a pre-commit tool that runs for every git-commit action: Husky. The second tool that is needed is lint-staged, which will run specified scripts on matching staged files. Aside from these tools, we need a code repository with actual linting tools. We will be using an Angular project as an example with the Angular ESLint and Prettier pre-configured.
-
Angular: Migrate from TSLint to ESLint
You can find all necessary tools and information to simplify the migration of existing Angular projects to ESLint at the GitHub Repo Angular ESLint.
rushstack
-
How do you handle eslint/prettier configs across multiple repos?
If you're looking to recreate the ease of a monorepo with eslint/prettier, I've used the rushstack eslint patch to ship an eslint package which is almost fully self-contained, not just config, but dependencies as well: https://github.com/microsoft/rushstack/tree/main/eslint/eslint-patch
-
Handling TypeScript in a monorepo
I highly recommend rushstack. It’s a suite of tools for managing TypeScript monorepos. I use it at work and never want to go back to working without it.
-
Are there build systems for the JS/TS world?
https://rushjs.io/ and https://rushstack.io/
-
Lerna has gone. Which Monorepo is right for a Node.js BACKEND now?
Rush Stack. It’s an opinionated, batteries-included toolset for working with large monorepos. It’s highly extensible and pluggable, and has built-in support for a lot of common tasks. My team uses it at work to support a couple dozen projects and at this point I can’t imagine managing a monorepo without it. It has significant adoption within and support from Microsoft, and monthly public dev meetings with contributors from a number of other companies, so I really don’t think it’s going to disappear any time soon. From what I’ve seen, it’s a very healthy project that’s continuing to grow in support and adoption.
-
Micro-frontends building blocks: Monorepos
Tools like Lerna, Bazel, Nx, Rush, Turborepo, to name a few. Lerna is probably the grand daddy of all monorepo tools. CRA, Babel, Jest are a few projects that use it. Bazel has been refined and tested for years at Google to build heavy-duty, mission-critical infrastructure, services, and applications. Turborepo is the monorepo for Vercel, the leading platform for frontend frameworks. These tools can help keep your monorepo workspaces fast, understandable and manageable.
-
Typescript book with web and/or node.js fundamentals?
We don’t use backend node, I work in a big typescript monorepo and use Typescript to build plugins for compiling, packing, and testing, leveraging Rush and Heft on the client side (https://github.com/microsoft/rushstack) run via node
-
Rush and changelog generation - Part 2
I guess I'm not alone wishing that rush uses commit messages for change log generation. It's actually not so difficult (once it's done 😎).
-
"We made an open source app that tells you the time so we are the leaders in open source"
See: ONNX/ONNX Runtime, VSCode, Rush, & countless others
- Dev corrupts NPM libs 'colors' and 'faker' breaking thousands of apps
-
Tell HN: Microsoft forks MIT licensed repo, and changes the copyright to them
To late to edit or delete my comment above but just to set it straight I just learned that the whole lerna debacle linked above was a nothing-burger aka “fake news”.
https://github.com/microsoft/rushstack/issues/673#issuecomme...
What are some alternatives?
typescript-eslint - :sparkles: Monorepo for all the tooling which enables ESLint to support TypeScript
turborepo - Incremental bundler and build system optimized for JavaScript and TypeScript, written in Rust – including Turborepo and Turbopack. [Moved to: https://github.com/vercel/turbo]
mockoon - Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.
lerna - :dragon: Lerna is a fast, modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository.
angular-eslint - Application example built with Angular 14 and adding the ESLint using @angular-eslint/schematics library.
husky - Git hooks made easy 🐶 woof!
prettier - Prettier is an opinionated code formatter.
typescript-monorepo-example - An example of setting up a Lerna monorepo with Visual Studio Code and TypeScript
eslint-plugin-storybook - 🎗Official ESLint plugin for Storybook
nodejs-api-starter - 💥 Yarn v2 based monorepo template (seed project) pre-configured with GraphQL API, PostgreSQL, React, Relay, and Material UI. [Moved to: https://github.com/kriasoft/relay-starter-kit]
transloco - 🚀 😍 The internationalization (i18n) library for Angular
tslint - :vertical_traffic_light: An extensible linter for the TypeScript language