mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
TSLint → ESLint (#21006)
* Alphabetized tslint and tsconfig files * Optimized tsconfig files * Optimized editorconfig & prettier config files … to reduce redundancy * Switched to @grafana/tsconfig … and: * de-duped options * removed options with default values * Fixed nasty issue with types for nested slate-react * Replaced TSLint with ESLint * TSLint disables → ESLint disables … also JSHint removals, which haven’t had an affect since it was replaced with TSLint. * Compliances for ESLint, Prettier and TypeScript * Updated lockfile
This commit is contained in:
6
packages/grafana-data/.eslintrc
Normal file
6
packages/grafana-data/.eslintrc
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": ["@grafana/eslint-config"],
|
||||
"rules": {
|
||||
"no-restricted-imports": [2, "^@grafana/data.*", "^@grafana/runtime.*", "^@grafana/ui.*"]
|
||||
}
|
||||
}
|
@@ -14,13 +14,15 @@
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"scripts": {
|
||||
"tslint": "tslint -c tslint.json --project tsconfig.json",
|
||||
"lint": "eslint src/ --ext=.js,.ts,.tsx",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"clean": "rimraf ./dist ./compiled",
|
||||
"bundle": "rollup -c rollup.config.ts",
|
||||
"build": "grafana-toolkit package:build --scope=data"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@grafana/eslint-config": "^1.0.0-rc1",
|
||||
"@grafana/tsconfig": "^1.0.0-rc1",
|
||||
"@types/jest": "23.3.14",
|
||||
"@types/jquery": "1.10.35",
|
||||
"@types/lodash": "4.14.123",
|
||||
|
@@ -6,7 +6,7 @@ import { toDataFrameDTO, toDataFrame } from './processDataFrame';
|
||||
import { FieldType } from '../types';
|
||||
import { Table } from 'apache-arrow';
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
const resp = {
|
||||
results: {
|
||||
'': {
|
||||
@@ -21,7 +21,7 @@ const resp = {
|
||||
},
|
||||
},
|
||||
};
|
||||
/* tslint:enable */
|
||||
/* eslint-enable */
|
||||
|
||||
describe('GEL Utils', () => {
|
||||
test('should parse output with dataframe', () => {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { TimeZone } from '../types/time';
|
||||
/* tslint:disable:import-blacklist ban ban-types */
|
||||
/* eslint-disable id-blacklist, no-restricted-imports, @typescript-eslint/ban-types */
|
||||
import moment, { Moment, MomentInput, DurationInputArg1 } from 'moment';
|
||||
export interface DateTimeBuiltinFormat {
|
||||
__momentBuiltinFormatBrand: any;
|
||||
|
@@ -14,7 +14,7 @@ interface AppendedVectorInfo<T> {
|
||||
*/
|
||||
export class AppendedVectors<T = any> implements Vector<T> {
|
||||
length = 0;
|
||||
source: Array<AppendedVectorInfo<T>> = new Array<AppendedVectorInfo<T>>();
|
||||
source: Array<AppendedVectorInfo<T>> = [];
|
||||
|
||||
constructor(startAt = 0) {
|
||||
this.length = startAt;
|
||||
@@ -29,7 +29,7 @@ export class AppendedVectors<T = any> implements Vector<T> {
|
||||
this.length = length;
|
||||
} else if (length < this.length) {
|
||||
// make the array shorter
|
||||
const sources: Array<AppendedVectorInfo<T>> = new Array<AppendedVectorInfo<T>>();
|
||||
const sources: Array<AppendedVectorInfo<T>> = [];
|
||||
for (const src of this.source) {
|
||||
sources.push(src);
|
||||
if (src.end > length) {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"exclude": ["dist", "node_modules", "**/*.test.ts", "**/*.test.tsx"]
|
||||
"exclude": ["dist", "node_modules", "**/*.test.ts*"],
|
||||
"extends": "./tsconfig.json"
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"include": ["src/**/*.ts", "src/**/*.tsx", "../../public/app/types/jquery/*.ts"],
|
||||
"exclude": ["dist", "node_modules"],
|
||||
"compilerOptions": {
|
||||
"rootDirs": ["."],
|
||||
"typeRoots": ["./node_modules/@types", "types"],
|
||||
"declarationDir": "dist",
|
||||
"outDir": "compiled"
|
||||
}
|
||||
"outDir": "compiled",
|
||||
"rootDirs": ["."],
|
||||
"typeRoots": ["node_modules/@types"]
|
||||
},
|
||||
"exclude": ["dist", "node_modules"],
|
||||
"extends": "@grafana/tsconfig",
|
||||
"include": ["src/**/*.ts*", "../../public/app/types/jquery/*.ts"]
|
||||
}
|
||||
|
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"extends": "../../tslint.json",
|
||||
"rules": {
|
||||
"import-blacklist": [true, ["^@grafana/data.*"], ["^@grafana/ui.*"], ["^@grafana/runtime.*"]]
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user