Skip to content

Latest commit

 

History

History
546 lines (531 loc) · 15.7 KB

File metadata and controls

546 lines (531 loc) · 15.7 KB

Snapshot report for test/lib/autofix/autofix.projects.ts

The actual snapshot is saved in autofix.projects.ts.snap.

Generated by AVA.

lint: All files of library with sap.ui.unified namespace

Snapshot 1

[
  {
    coverageInfo: [],
    errorCount: 2,
    fatalErrorCount: 0,
    filePath: 'src/sap/ui/unified/ColorPicker.js',
    messages: [
      {
        column: 22,
        line: 10,
        message: 'Access of global variable \'sap\' (sap.ui.unified.ColorPicker)',
        ruleId: 'no-globals',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 39,
        line: 20,
        message: 'Access of module \'sap/ui/unified/ColorPickerDisplayMode\' (Library.ColorPickerDisplayMode) not exported by library \'sap/ui/unified/library\'',
        ruleId: 'no-implicit-globals',
        severity: 2,
        ui5TypeInfo: undefined,
      },
    ],
    warningCount: 0,
  },
  {
    coverageInfo: [],
    errorCount: 1,
    fatalErrorCount: 0,
    filePath: 'src/sap/ui/unified/library.js',
    messages: [
      {
        column: 22,
        line: 45,
        message: 'Access of global variable \'sap\' (sap.ui.unified)',
        ruleId: 'no-globals',
        severity: 2,
        ui5TypeInfo: undefined,
      },
    ],
    warningCount: 0,
  },
]

AutofixResult iteration #0: /resources/sap/ui/unified/ColorPicker.js

`sap.ui.define([␊
	// This file covers the case where a framework library contains a relative import␊
	// to a library module from which an implicit global is accessed.␊
	"./library"␊
], function (Library) {␊
	"use strict";␊

	// This global usage should not be replaced with an import of sap/ui/unified/ColorPicker␊
	// as it would import the module itself.␊
	const ColorPicker = sap.ui.unified.ColorPicker;␊

	// This global usage should re-use the import of sap/ui/unified/library␊
	// even thought it is relative to the current module and not absolute.␊
	var ColorPickerModeViaGlobal = Library.ColorPickerMode;␊

	var ColorPickerMode = Library['ColorPickerMode'];␊

	// This is a special case as ColorPickerDisplayMode is defined in its own module but also exported via the library module.␊
	// However, this export from the library module is not reflected in the types / api.json, so it is still reported as implicit global usage.␊
	var ColorPickerDisplayMode = Library['ColorPickerDisplayMode'];␊
});␊
`

AutofixResult iteration #0: /resources/sap/ui/unified/Foo.js

`// This file ensures that relative paths are correctly resolved when auto-fixing globals␊
// and that existing unnamed imports keeping their relative path.␊
sap.ui.define(["../unified/library"], function(unifiedLibrary) {␊
	var ColorPickerMode = unifiedLibrary.ColorPickerMode;␊
});␊
`

lint: All files of library with sap.ui.core namespace

Snapshot 1

[
  {
    coverageInfo: [],
    errorCount: 5,
    fatalErrorCount: 0,
    filePath: 'src/sap/ui/core/Core.js',
    messages: [
      {
        column: 6,
        line: 3,
        message: 'Use of deprecated property \'getCore\' (sap.ui.getCore)',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: {
          kind: 'Function',
          name: 'getCore',
          parent: {
            kind: 'Namespace',
            name: 'ui',
            parent: {
              kind: 'Namespace',
              name: 'sap',
            },
          },
        },
      },
      {
        column: 24,
        line: 3,
        message: 'Access of global variable \'sap\' (sap.ui.getCore)',
        ruleId: 'no-globals',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 31,
        line: 3,
        message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: {
          kind: 'Function',
          name: 'getCore',
          parent: {
            kind: 'Namespace',
            name: 'ui',
            parent: {
              kind: 'Namespace',
              name: 'sap',
            },
          },
        },
      },
      {
        column: 10,
        line: 4,
        message: 'Access of global variable \'sap\' (sap.ui.getCore)',
        ruleId: 'no-globals',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 17,
        line: 4,
        message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: {
          kind: 'Function',
          name: 'getCore',
          parent: {
            kind: 'Namespace',
            name: 'ui',
            parent: {
              kind: 'Namespace',
              name: 'sap',
            },
          },
        },
      },
    ],
    warningCount: 0,
  },
  {
    coverageInfo: [],
    errorCount: 18,
    fatalErrorCount: 0,
    filePath: 'src/sap/ui/core/FancyText.js',
    messages: [
      {
        column: 26,
        line: 3,
        message: 'Use of deprecated property \'DateTimeInputType\' (library.DateTimeInputType)',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: {
          kind: 'Enum',
          name: 'DateTimeInputType',
          parent: {
            kind: 'Module',
            library: 'sap.m',
            name: 'sap/m/library',
          },
        },
      },
      {
        column: 17,
        line: 8,
        message: 'Use of deprecated interface \'sap.ui.commons.FormattedTextViewControl\'',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 16,
        line: 12,
        message: 'Use of deprecated type \'sap.f.AvatarShape\'',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 27,
        line: 14,
        message: 'Use of deprecated type \'sap.m.DateTimeInputType\'',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 89,
        line: 14,
        message: 'Use of deprecated property \'DateTime\' (DateTimeInputType.DateTime)',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: {
          kind: 'EnumMember',
          name: 'DateTime',
          parent: {
            kind: 'Enum',
            name: 'DateTimeInputType',
            parent: {
              kind: 'Module',
              library: 'sap.m',
              name: 'sap/m/library',
            },
          },
        },
      },
      {
        column: 28,
        line: 16,
        message: 'Use of deprecated type \'sap.m.DateTimeInputType\'',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 76,
        line: 16,
        message: 'Use of deprecated type \'Date\'',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 77,
        line: 18,
        message: 'Use of deprecated property \'TwoThirds\' (FrameType.TwoThirds)',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: {
          kind: 'EnumMember',
          name: 'TwoThirds',
          parent: {
            kind: 'Enum',
            name: 'FrameType',
            parent: {
              kind: 'Module',
              library: 'sap.m',
              name: 'sap/m/library',
            },
          },
        },
      },
      {
        column: 64,
        line: 20,
        message: 'Use of deprecated type \'TwoThirds\'',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 19,
        line: 24,
        message: 'Use of deprecated class \'sap.f.Avatar\'',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 17,
        line: 26,
        message: 'Use of deprecated class \'sap.f.Avatar\'',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 69,
        line: 28,
        message: 'Use of deprecated type \'sap.f.IllustratedMessageSize\'',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 36,
        line: 40,
        message: 'Use of deprecated class \'sap.f.Avatar\'',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 34,
        line: 42,
        message: 'Use of deprecated class \'sap.f.Avatar\'',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 14,
        line: 48,
        message: 'Use of deprecated type \'sap.f.DynamicPageTitleArea\'',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 14,
        line: 55,
        message: 'Use of deprecated type \'sap.f.DynamicPageTitleArea\'',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 15,
        line: 61,
        message: 'Use of deprecated type \'sap.f.AvatarShape\'',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 14,
        line: 63,
        message: 'Use of deprecated class \'sap.m.P13nColumnsItem\'',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: undefined,
      },
    ],
    warningCount: 0,
  },
  {
    coverageInfo: [],
    errorCount: 7,
    fatalErrorCount: 0,
    filePath: 'src/ui5loader.js',
    messages: [
      {
        column: 2,
        line: 28,
        message: 'Access of global variable \'sap\' (__global.sap)',
        ruleId: 'no-globals',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 17,
        line: 28,
        message: 'Access of global variable \'sap\' (__global.sap)',
        ruleId: 'no-globals',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 2,
        line: 29,
        message: 'Access of global variable \'sap\' (sap.ui)',
        ruleId: 'no-globals',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 11,
        line: 29,
        message: 'Access of global variable \'sap\' (sap.ui)',
        ruleId: 'no-globals',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 2,
        line: 40,
        message: 'Access of global variable \'sap\' (sap.ui.loader)',
        ruleId: 'no-globals',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 2,
        line: 48,
        message: 'Access of global variable \'sap\' (sap.ui.predefine)',
        ruleId: 'no-globals',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 2,
        line: 79,
        message: 'Access of global variable \'sap\' (sap.ui.requireSync)',
        ruleId: 'no-globals',
        severity: 2,
        ui5TypeInfo: undefined,
      },
    ],
    warningCount: 0,
  },
]

lint: All files of globals application

Snapshot 1

[
  {
    coverageInfo: [],
    errorCount: 3,
    fatalErrorCount: 0,
    filePath: 'webapp/test/globalFactory1.js',
    messages: [
      {
        column: 1,
        line: 2,
        message: 'Access of global variable \'sap\' (sap.ui.getCore)',
        ruleId: 'no-globals',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 8,
        line: 2,
        message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: {
          kind: 'Function',
          name: 'getCore',
          parent: {
            kind: 'Namespace',
            name: 'ui',
            parent: {
              kind: 'Namespace',
              name: 'sap',
            },
          },
        },
      },
      {
        column: 18,
        line: 2,
        message: 'Call to deprecated function \'attachInit\' of class \'Core\'',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: {
          kind: 'Method',
          name: 'attachInit',
          parent: {
            kind: 'Class',
            name: 'Core',
            parent: {
              kind: 'Module',
              library: 'sap.ui.core',
              name: 'sap/ui/core/Core',
            },
          },
        },
      },
    ],
    warningCount: 0,
  },
  {
    coverageInfo: [],
    errorCount: 3,
    fatalErrorCount: 0,
    filePath: 'webapp/test/globalFactory2.js',
    messages: [
      {
        column: 1,
        line: 4,
        message: 'Access of global variable \'sap\' (sap.ui.getCore)',
        ruleId: 'no-globals',
        severity: 2,
        ui5TypeInfo: undefined,
      },
      {
        column: 8,
        line: 4,
        message: 'Call to deprecated function \'getCore\' (sap.ui.getCore)',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: {
          kind: 'Function',
          name: 'getCore',
          parent: {
            kind: 'Namespace',
            name: 'ui',
            parent: {
              kind: 'Namespace',
              name: 'sap',
            },
          },
        },
      },
      {
        column: 18,
        line: 4,
        message: 'Call to deprecated function \'attachInit\' of class \'Core\'',
        ruleId: 'no-deprecated-api',
        severity: 2,
        ui5TypeInfo: {
          kind: 'Method',
          name: 'attachInit',
          parent: {
            kind: 'Class',
            name: 'Core',
            parent: {
              kind: 'Module',
              library: 'sap.ui.core',
              name: 'sap/ui/core/Core',
            },
          },
        },
      },
    ],
    warningCount: 0,
  },
]