mirror of
https://github.com/grafana/grafana.git
synced 2024-11-27 19:30:36 -06:00
4b4d546e32
* wip * make diff easier to read * Update template_srv getVariables to return new TypedVariableModel * update VariableType to use the type from TypedVariableModel * tidy things up * Chore: Use type-accurate mock variables in tests * Chore: Type VariableState to use TypedVariableModel * fix typo * remove type assertion from template_srv.getVariables * use typescript/no-redeclare for compatibility with ts overloads * remove generics from getVariable() and overload it to only return undefined based on arguments * update usages of getVariable() * Fix Interval variable options picker not working
52 lines
1.4 KiB
Plaintext
52 lines
1.4 KiB
Plaintext
{
|
|
"extends": ["@grafana/eslint-config"],
|
|
"root": true,
|
|
"plugins": ["@emotion", "lodash", "jest", "import"],
|
|
"settings": {
|
|
"import/internal-regex": "^(app/)|(@grafana)",
|
|
"import/external-module-folders": ["node_modules", ".yarn"]
|
|
},
|
|
"rules": {
|
|
"react/prop-types": "off",
|
|
"@emotion/jsx-import": "error",
|
|
"lodash/import-scope": [2, "member"],
|
|
"jest/no-focused-tests": "error",
|
|
"import/order": [
|
|
"error",
|
|
{
|
|
"groups": [["builtin", "external"], "internal", "parent", "sibling", "index"],
|
|
"newlines-between": "always",
|
|
"alphabetize": { "order": "asc" }
|
|
}
|
|
],
|
|
|
|
// Use typescript's no-redeclare for compatibility with overrides
|
|
"no-redeclare": "off",
|
|
"@typescript-eslint/no-redeclare": ["error"]
|
|
},
|
|
"overrides": [
|
|
{
|
|
"files": ["packages/grafana-ui/src/components/uPlot/**/*.{ts,tsx}"],
|
|
"rules": {
|
|
"react-hooks/rules-of-hooks": "off",
|
|
"react-hooks/exhaustive-deps": "off"
|
|
}
|
|
},
|
|
{
|
|
"files": ["packages/grafana-ui/src/components/ThemeDemos/**/*.{ts,tsx}"],
|
|
"rules": {
|
|
"@emotion/jsx-import": "off",
|
|
"react/jsx-uses-react": "off",
|
|
"react/react-in-jsx-scope": "off"
|
|
}
|
|
},
|
|
{
|
|
"files": ["public/dashboards/scripted*.js"],
|
|
"rules": {
|
|
"no-redeclare": "error",
|
|
"@typescript-eslint/no-redeclare": "off"
|
|
}
|
|
}
|
|
]
|
|
}
|