initial commit of actions
This commit is contained in:
commit
949ece5785
44660 changed files with 12034344 additions and 0 deletions
32
github/codeql-action-v1/node_modules/eslint-plugin-filenames/lib/rules/no-index.js
generated
vendored
Normal file
32
github/codeql-action-v1/node_modules/eslint-plugin-filenames/lib/rules/no-index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/**
|
||||
* @fileoverview Rule to ensure that there exist no index files
|
||||
* @author Stefan Lau
|
||||
*/
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
var path = require('path'),
|
||||
parseFilename = require('../common/parseFilename'),
|
||||
isIgnoredFilename = require('../common/isIgnoredFilename'),
|
||||
isIndexFile = require('../common/isIndexFile');
|
||||
|
||||
module.exports = function(context) {
|
||||
return {
|
||||
"Program": function(node) {
|
||||
var filename = context.getFilename(),
|
||||
absoluteFilename = path.resolve(filename),
|
||||
parsed = parseFilename(absoluteFilename),
|
||||
shouldIgnore = isIgnoredFilename(filename),
|
||||
isIndex = isIndexFile(parsed);
|
||||
|
||||
|
||||
if (shouldIgnore) return;
|
||||
if (isIndex) {
|
||||
context.report(node, "'index.js' files are not allowed.");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue