@builder.io/eslint-plugin-mitosis
Version:
A Mitosis plugin containing rules that help you write valid and idiomatic Mitosis code
24 lines (23 loc) • 559 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var path = require("path");
/**
* Restrict rule to only files that have a '.lite' ext, multiple exts is fine
* (like file.lite.jsx).
*
* @example
* ```typescript
* isMitosisPath('file.jsx')
* // false
*
* isMitosisPath('file.lite.jsx')
* // true
* ```
*/
function isMitosisPath(filename) {
filename = path.basename(filename);
var tokens = filename.split('.');
var exts = tokens.splice(1);
return exts.includes('lite');
}
exports.default = isMitosisPath;