This site uses cookies for analytics. By continuing to browse this site, you agree to this use.
A JS Foundation Project

Disallow non-standard file extension for the web app manifest file

Disallow non-standard file extension for the web app manifest file (@sonarwhal/rule-manifest-file-extension)

manifest-file-extension warns against using non-standard file extensions for the web app manifest file.

Why is this important?

While the .webmanifest file extension is not enforced by the specification, nor is it required by browsers, using it makes it:

What does the rule check?

The rule checks if the recommended .webmanifest file extension is used for the web app manifest file.

Examples that trigger the rule

<link rel="manifest" href="site.json">
<link rel="manifest" href="site.manifest">

Examples that pass the rule

<link rel="manifest" href="site.webmanifest">

How to use this rule?

To use it you will have to install it via npm:

npm install @sonarwhal/rule-manifest-file-extension

Note: You can make npm install it as a devDependency using the --save-dev parameter, or to install it globally, you can use the -g parameter. For other options see npm's documentation.

And then activate it via the .sonarwhalrc configuration file:

{
"connector": {...},
"formatters": [...],
"parsers": [...],
"rules": {
"manifest-file-extension": "error"
},
...
}

Further Reading