Update lint

This commit is contained in:
Andros Fenollosa 2020-07-02 14:42:59 +02:00
parent 6ad8220681
commit 58c4b546bb
2 changed files with 14 additions and 5 deletions

2
dist/ffnm.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,10 @@
//=== //===
// VARIABLES // VARIABLES
//=== //===
const EVENTS = ['i-click', 'i-scroll-up', 'i-scroll-down', 'i-hover']; const EVENTS = ['i-click', 'i-view', 'i-scroll-up', 'i-scroll-down', 'i-hover'];
const FUNCTION_TREE = {
'class': ['add', 'remove', 'toggle']
};
//=== //===
// FUNCTIONS // FUNCTIONS
@ -13,9 +16,15 @@ function validateSyntax() {
// Check all event syntax // Check all event syntax
return EVENTS.map((event) => { return EVENTS.map((event) => {
// Check element FUNCTION_TREE
return R.map((element) => { return R.map((element) => {
console.log(element.getAttribute(event)); // Check KEY FUNCTION_TREE
return /^${event}/.test(element.getAttribute(event)); return R.map((key) => {
// Check METHODS FUNCTION_TREE
return R.map((method) => {
return RegExp(`^${key}:${method}\\('\\w+', *'[#,.,a-zA-Z]\\w*'\\)$`).test(element.getAttribute(event));
}, FUNCTION_TREE[key]).some(method => method);
}, Object.keys(FUNCTION_TREE)).every(key => key);
}, document.querySelectorAll(`[${event}]`)).every(item => item); }, document.querySelectorAll(`[${event}]`)).every(item => item);
}).every(event => event); }).every(event => event);
} }
@ -29,4 +38,4 @@ function validateSyntax() {
//=== //===
// INIT // INIT
//=== //===
validateSyntax(); console.log("EStabien " + validateSyntax());