unlight / eslint-plugin-ngxs-style-guide Goto Github PK
View Code? Open in Web Editor NEWESLint rules for ngxs state manager
License: MIT License
ESLint rules for ngxs state manager
License: MIT License
ng new
ng add @angular-eslint/schematics
npm install --save-dev eslint-plugin-ngxs-style-guide
ng lint
or npm run lint
An unhandled exception occurred:
Failed to load plugin 'ngxs-style-guide' declared in '.eslintrc.json#overrides[0]':
Class extends value undefined is not a constructor or null
Referenced from: <project_path>\.eslintrc.json
See "<temp_dir>\ng-mlwbyZ\angular-errors.log" for further details.
16.13.0
13.0.3
8.2.0
2.0.2
{
"root": true,
"ignorePatterns": ["projects/**/*"],
"overrides": [
{
"files": ["*.ts"],
"parserOptions": {
"project": ["tsconfig.json"],
"createDefaultProgram": true
},
"extends": [
"plugin:rxjs/recommended",
"plugin:ngxs-style-guide/recommended",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"plugins": ["ngxs-style-guide", "rxjs"],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "app",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "app",
"style": "kebab-case"
}
],
"rxjs/no-unsafe-takeuntil": [
"error",
{
"alias": ["untilDestroyed"]
}
],
"quotes": [
2,
"single",
{
"avoidEscape": true,
"allowTemplateLiterals": true
}
],
"indent": ["error", 4],
"init-declarations": "off"
}
},
{
"files": ["*.html"],
"extends": ["plugin:@angular-eslint/template/recommended"],
"rules": {}
}
]
}
Hi @unlight,
I already noticed that you have
return observable from action
on your todo list (see the README.md
). I would be really happy if you could implement it. But with a slight modification. From my understanding (please compare with https://www.ngxs.io/concepts/state#defining-actions) the following return values for actions seems to be valid:
void
Observable<T>
Promise<T>
So it would be really helpful to have a rule in this great plugin to have an eye on this requirement as well.
What do you think about?
Best,
Sven
Hi there!
Thanks for the great plugin @unlight !
We're already using it in some of our TypeScript 3.x projects. We wanted to use it in a new project with TypeScript 4.x as well, but sadly the plugin itself have a dependency to TypeScript 3.x. Could you please fix it and allow TypeScript 4.x as well?
Best,
Sven
Hi @unlight ,
could you please describe the new rule, that you've added with release 2.0 of this great plugin: ngxs-style-guide/no-pipe-dispatch
? Maybe you get a source or explanation by hand, showing why it's important to avoid a pipe(...)
after a dispatch(...)
?
I'm asking because I thought this plugin serves as an ESLint plugin for the official best practices: https://www.ngxs.io/recipes/style-guide (even if this plugin is not authored by the NGXS creator) And I can't find a recommendation regarding the pipe-dispatch there.
Best,
Sven
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.