1.3.22 • Published 4 years ago

@sap/eslint-plugin-webide-feature v1.3.22

Weekly downloads
5,307
License
SEE LICENSE IN de...
Repository
-
Last release
4 years ago

ESLint plugin for SAP Web IDE features

Table of contents

Overview

This is the eslint plugin for Web IDE features. It contains a set of eslint rules and recommended ESLint configuration for static code checks to be used by Web IDE feature developers.

Usage

Add linting to tests

To add this package as a dependency in your package.json file, do the following:

  1. Under the "scripts" section, add: "lint": "eslint src"
  2. Under the "scripts" section, add: "npm run lint" to the test section: "test": "npm run lint && ..."
  3. Under the "devDependencies" section, add the following dependency: "@sap/eslint-plugin-webide-feature": "a.b.c"
  4. Add .eslintrc.json file with the following content:
{
	"plugins": ["@sap/webide-feature"],
	"extends": "plugin:@sap/webide-feature/recommended-internal"
}

The linting checks will be executed as part of tests.

Please note that each version of this ESLint plugin corresponds to certain version of SAP Web IDE. As cloud version of SAP Web IDE is continiously updated it is strongly recommended to update the version of this plugin as soon as it is released. To update your feature to use the latest version of ESLint plugin, run: npm install --save-exact @sap/eslint-plugin-webide-feature@latest

Fix existing lint issues

After you have added linting, please execute it with npm run lint. Do not worry if you see lots of warnings and errors most of the can be fixed automatically with --fix option of ESLint, by running node_modules/.bin/eslint src --fix. Remaining issues can be fixed manually or ignored by using special comments or overrding recommended configuration values. To fix the issues manually please refer to the documentation of specific rule.

List of rules

RuleDescriptionRecommended Severity
no-private-methodsDo not invoke private methodsError
no-private-apisDo not invoke private methodsWarning
bundled-uris-valid"bundledPlugins" and "bundledFeatures" arrays items must start with "file:" and have valid uriError
no-deprecated-fieldspackage.json file should contain neither deprecatedPluginExtensions nor deprecatedConfigIncludes fieldsWarning
feature-description-validpackage.json file must contain description fieldWarning
homepage-url-validpackage.json file must contain a homepage field with a valid pathWarning
package-json-existspackage.json file must exist in feature's root folderError
consistent-idseach package.json and plugin.json file must has consistent idsError
feature-name-validpackage.json file must contain name fieldError
no-optional-featurespackage.json file must not contain optionalBundledFeatures fieldError
feature-author-validpackage.json file must contain an author field with name and iconWarning
feature-version-validpackage.json file must contain a version fieldError
webide-dependencies-consistent"webideDependencies" section should be declared properlyError
plugin-name-validplugin.json file must contain name fieldError
plugin-provides-validservice and interface file references in "plugin.json" file must be validError
no-unused-required-servicesAll required services of a plugin must be in useWarning
valid-json-filesAll JSON files in a feature must be validError