mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Improve decoupled-plugin linter (#75285)
This commit is contained in:
parent
ece94b1e01
commit
6b54aee4ba
29
.eslintrc
29
.eslintrc
@ -99,27 +99,22 @@
|
||||
"public/app/plugins/datasource/grafana-testdata-datasource/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/grafana-testdata-datasource/**/*.{ts,tsx}"
|
||||
],
|
||||
"settings": {
|
||||
"import/resolver": {
|
||||
"node": {
|
||||
"extensions": [".ts", ".tsx"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
"no-restricted-imports": [
|
||||
"import/no-restricted-paths": [
|
||||
"error",
|
||||
{
|
||||
"paths": [
|
||||
// generic rules
|
||||
"zones": [
|
||||
{
|
||||
"name": "react-redux",
|
||||
"importNames": ["useDispatch", "useSelector"],
|
||||
"message": "Please import from app/types instead."
|
||||
},
|
||||
{
|
||||
"name": "react-i18next",
|
||||
"importNames": ["Trans", "t"],
|
||||
"message": "Please import from app/core/internationalization instead"
|
||||
}
|
||||
],
|
||||
// new rules
|
||||
"patterns": [
|
||||
{
|
||||
"group": ["**/app/*"],
|
||||
"target": "./public/app/plugins",
|
||||
"from": "./public/app",
|
||||
"except": ["./plugins"],
|
||||
"message": "Core plugins are not allowed to depend on Grafana core packages"
|
||||
}
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user