eslint-plugin-functional
Advanced tools
Comparing version 3.2.1 to 3.2.2
@@ -10,4 +10,10 @@ # Changelog | ||
## [v3.2.1](https://github.com/jonaskello/eslint-plugin-functional/compare/v3.1.0...v3.2.1) | ||
## [v3.2.2](https://github.com/jonaskello/eslint-plugin-functional/compare/v3.2.1...v3.2.2) | ||
### Fixed | ||
- fix(prefer-type-literal): deprecated rule [`#170`](https://github.com/jonaskello/eslint-plugin-functional/issues/170) | ||
## [v3.2.1](https://github.com/jonaskello/eslint-plugin-functional/compare/v3.1.0...v3.2.1) - 2021-01-01 | ||
### Merged | ||
@@ -29,4 +35,4 @@ | ||
- feat(prefer-readonly-type): add option ignoreCollections [`b6856fa`](https://github.com/jonaskello/eslint-plugin-functional/commit/b6856fa9d8a3182273c2f41dbcdd94bf88025b6a) | ||
- docs(prefer-type-literal): remove mention of removed option allowLocalMutation from docs [`83da8bf`](https://github.com/jonaskello/eslint-plugin-functional/commit/83da8bf4fe5e368af65e18d6f29942d31a00f863) | ||
- feat(prefer-readonly-type): add option ignoreCollections [`ad53072`](https://github.com/jonaskello/eslint-plugin-functional/commit/ad530729488bdab9c41db58cc4152a338d229a94) | ||
- docs(prefer-type-literal): remove mention of removed option allowLocalMutation from docs [`c4b4051`](https://github.com/jonaskello/eslint-plugin-functional/commit/c4b4051c4145e9bab708c21079aabffa4d30c3cf) | ||
@@ -82,5 +88,5 @@ ## [v3.0.2](https://github.com/jonaskello/eslint-plugin-functional/compare/v3.0.1...v3.0.2) - 2020-08-23 | ||
- docs(changelog): update changelog for v3.0.0 [`0ef88c7`](https://github.com/jonaskello/eslint-plugin-functional/commit/0ef88c73b7e2dc466f6d3cf94be04e6bc481498d) | ||
- build: auto changelog changes are now part of the same git commit as the release [`00e3b6f`](https://github.com/jonaskello/eslint-plugin-functional/commit/00e3b6ff608480dd7589bf76d1cc1a26e8219874) | ||
- docs(readme): fix issue with svg image not displaying on npmjs [`d91dc90`](https://github.com/jonaskello/eslint-plugin-functional/commit/d91dc90186f6a6537bfb3098d6a326b4890451aa) | ||
- docs(changelog): update changelog for v3.0.0 [`d248311`](https://github.com/jonaskello/eslint-plugin-functional/commit/d248311afb21ce3c976dc44d69bafa9327602ff0) | ||
- build: auto changelog changes are now part of the same git commit as the release [`7c369c8`](https://github.com/jonaskello/eslint-plugin-functional/commit/7c369c89436c2b27177eafe5d56d6ce2f48b0402) | ||
- docs(readme): fix issue with svg image not displaying on npmjs [`aa4f573`](https://github.com/jonaskello/eslint-plugin-functional/commit/aa4f57304c2e9b81ba7484a8b5d8edc08e979024) | ||
@@ -100,3 +106,3 @@ ## [v3.0.0](https://github.com/jonaskello/eslint-plugin-functional/compare/v2.0.0...v3.0.0) - 2020-01-12 | ||
- **Breaking change:** build(dep): update all dependencies [`cae4c49`](https://github.com/jonaskello/eslint-plugin-functional/commit/cae4c49bdf3cd0845e399819046941fa4d2ee13f) | ||
- **Breaking change:** build(dep): update all dependencies [`ce90405`](https://github.com/jonaskello/eslint-plugin-functional/commit/ce904054e3d29bcd7bae74756c844221acc10695) | ||
@@ -118,3 +124,3 @@ ## [v2.0.0](https://github.com/jonaskello/eslint-plugin-functional/compare/v1.0.3...v2.0.0) - 2019-12-29 | ||
- fix: fix config type infor [`154bbf1`](https://github.com/jonaskello/eslint-plugin-functional/commit/154bbf17f5e44ea5b78f3fa6ad21ecd715f22c53) | ||
- fix: fix config type infor [`0c4e097`](https://github.com/jonaskello/eslint-plugin-functional/commit/0c4e0976a5f3428e750d0e2876d115f21e29eb4c) | ||
@@ -221,3 +227,3 @@ ## [v1.0.3](https://github.com/jonaskello/eslint-plugin-functional/compare/v1.0.2...v1.0.3) - 2019-12-29 | ||
- **Breaking change:** feat(ignore options): text matching MemberExpression nodes should include the property name [`4968348`](https://github.com/jonaskello/eslint-plugin-functional/commit/496834816ac7a96a5f4c25adf9f2980d1bc24254) | ||
- **Breaking change:** feat(ignore options): text matching MemberExpression nodes should include the property name [`f4ab878`](https://github.com/jonaskello/eslint-plugin-functional/commit/f4ab878dc885e3286bb799090001af1527adab4f) | ||
@@ -270,3 +276,3 @@ ## [v0.4.0](https://github.com/jonaskello/eslint-plugin-functional/compare/v0.3.0...v0.4.0) - 2019-07-19 | ||
- chore(no-array-mutation): Port of rule. [`8831379`](https://github.com/jonaskello/eslint-plugin-functional/commit/8831379bcfa3eb1531e7d68d603b393cf2811ddf) | ||
- chore(no-array-mutation): Port of rule. [`48d6c71`](https://github.com/jonaskello/eslint-plugin-functional/commit/48d6c718efd3275b90164571de7a265498c034d9) | ||
@@ -273,0 +279,0 @@ ## v0.1.0 - 2019-07-01 |
365
lib/index.js
@@ -14,3 +14,3 @@ 'use strict'; | ||
const config = { | ||
const config$a = { | ||
rules: { | ||
@@ -45,3 +45,3 @@ "functional/functional-parameters": "error", | ||
const config$1 = { | ||
const config$9 = { | ||
rules: { | ||
@@ -52,3 +52,3 @@ "functional/functional-parameters": "error", | ||
const config$2 = { | ||
const config$8 = { | ||
rules: { | ||
@@ -76,3 +76,3 @@ "prefer-const": "error", | ||
const config$3 = { | ||
const config$7 = { | ||
rules: { | ||
@@ -93,3 +93,3 @@ "functional/no-let": "error", | ||
const config$4 = { | ||
const config$6 = { | ||
rules: { | ||
@@ -117,3 +117,3 @@ "functional/no-throw-statement": "error", | ||
const config$6 = { | ||
const config$4 = { | ||
rules: { | ||
@@ -134,11 +134,11 @@ "functional/no-expression-statement": "error", | ||
const config$7 = deepMerge.all([ | ||
config$1, | ||
config$3, | ||
const config$3 = deepMerge.all([ | ||
config$9, | ||
config$7, | ||
config$6, | ||
config$5, | ||
config$4, | ||
config$5, | ||
config$6, | ||
]); | ||
const config$8 = deepMerge__default['default'](config$7, { | ||
const config$2 = deepMerge__default['default'](config$3, { | ||
rules: { | ||
@@ -157,3 +157,3 @@ "functional/no-conditional-statement": "off", | ||
const config$9 = { | ||
const config$1 = { | ||
rules: { | ||
@@ -493,3 +493,3 @@ "functional/prefer-tacit": ["warn", { assumeTypes: { allowFixer: false } }], | ||
const version = "3.2.0"; | ||
const version = "3.2.1"; | ||
@@ -534,4 +534,4 @@ function checkNode(check, context, options) { | ||
const name = "functional-parameters"; | ||
const schema = [ | ||
const name$g = "functional-parameters"; | ||
const schema$g = [ | ||
deepMerge.all([ | ||
@@ -578,3 +578,3 @@ ignorePatternOptionSchema, | ||
]; | ||
const defaultOptions = { | ||
const defaultOptions$g = { | ||
allowRestParameter: false, | ||
@@ -587,3 +587,3 @@ allowArgumentsKeyword: false, | ||
}; | ||
const errorMessages = { | ||
const errorMessages$g = { | ||
restParam: "Unexpected rest parameter. Use a regular parameter of type array instead.", | ||
@@ -594,3 +594,3 @@ arguments: "Unexpected use of `arguments`. Use regular function arguments instead.", | ||
}; | ||
const meta = { | ||
const meta$g = { | ||
type: "suggestion", | ||
@@ -602,4 +602,4 @@ docs: { | ||
}, | ||
messages: errorMessages, | ||
schema, | ||
messages: errorMessages$g, | ||
schema: schema$g, | ||
}; | ||
@@ -652,3 +652,3 @@ function getRestParamViolations(allowRestParameter, node) { | ||
} | ||
function checkFunction(node, context, options) { | ||
function checkFunction$2(node, context, options) { | ||
return { | ||
@@ -678,6 +678,6 @@ context, | ||
} | ||
const rule = createRule(name, meta, defaultOptions, { | ||
FunctionDeclaration: checkFunction, | ||
FunctionExpression: checkFunction, | ||
ArrowFunctionExpression: checkFunction, | ||
const rule$g = createRule(name$g, meta$g, defaultOptions$g, { | ||
FunctionDeclaration: checkFunction$2, | ||
FunctionExpression: checkFunction$2, | ||
ArrowFunctionExpression: checkFunction$2, | ||
Identifier: checkIdentifier, | ||
@@ -695,4 +695,4 @@ }); | ||
const name$1 = "immutable-data"; | ||
const schema$1 = [ | ||
const name$f = "immutable-data"; | ||
const schema$f = [ | ||
deepMerge.all([ | ||
@@ -731,3 +731,3 @@ ignorePatternOptionSchema, | ||
]; | ||
const defaultOptions$1 = { | ||
const defaultOptions$f = { | ||
ignoreImmediateMutation: true, | ||
@@ -739,3 +739,3 @@ assumeTypes: { | ||
}; | ||
const errorMessages$1 = { | ||
const errorMessages$f = { | ||
generic: "Modifying an existing object/array is not allowed.", | ||
@@ -745,3 +745,3 @@ object: "Modifying properties of existing object not allowed.", | ||
}; | ||
const meta$1 = { | ||
const meta$f = { | ||
type: "suggestion", | ||
@@ -753,4 +753,4 @@ docs: { | ||
}, | ||
messages: errorMessages$1, | ||
schema: schema$1, | ||
messages: errorMessages$f, | ||
schema: schema$f, | ||
}; | ||
@@ -820,3 +820,3 @@ const arrayMutatorMethods = [ | ||
} | ||
function checkCallExpression(node, context, options) { | ||
function checkCallExpression$1(node, context, options) { | ||
const assumeTypesForArrays = options.assumeTypes === true || | ||
@@ -852,16 +852,16 @@ (options.assumeTypes !== false && options.assumeTypes.forArrays === true); | ||
} | ||
const rule$1 = createRule(name$1, meta$1, defaultOptions$1, { | ||
const rule$f = createRule(name$f, meta$f, defaultOptions$f, { | ||
AssignmentExpression: checkAssignmentExpression, | ||
UnaryExpression: checkUnaryExpression, | ||
UpdateExpression: checkUpdateExpression, | ||
CallExpression: checkCallExpression, | ||
CallExpression: checkCallExpression$1, | ||
}); | ||
const name$2 = "no-class"; | ||
const schema$2 = []; | ||
const defaultOptions$2 = {}; | ||
const errorMessages$2 = { | ||
const name$e = "no-class"; | ||
const schema$e = []; | ||
const defaultOptions$e = {}; | ||
const errorMessages$e = { | ||
generic: "Unexpected class, use functions not classes.", | ||
}; | ||
const meta$2 = { | ||
const meta$e = { | ||
type: "suggestion", | ||
@@ -873,4 +873,4 @@ docs: { | ||
}, | ||
messages: errorMessages$2, | ||
schema: schema$2, | ||
messages: errorMessages$e, | ||
schema: schema$e, | ||
}; | ||
@@ -880,6 +880,6 @@ function checkClass(node, context) { | ||
} | ||
const rule$2 = createRule(name$2, meta$2, defaultOptions$2, { ClassDeclaration: checkClass, ClassExpression: checkClass }); | ||
const rule$e = createRule(name$e, meta$e, defaultOptions$e, { ClassDeclaration: checkClass, ClassExpression: checkClass }); | ||
const name$3 = "no-conditional-statement"; | ||
const schema$3 = [ | ||
const name$d = "no-conditional-statement"; | ||
const schema$d = [ | ||
{ | ||
@@ -903,4 +903,4 @@ type: "object", | ||
]; | ||
const defaultOptions$3 = { allowReturningBranches: false }; | ||
const errorMessages$3 = { | ||
const defaultOptions$d = { allowReturningBranches: false }; | ||
const errorMessages$d = { | ||
incompleteBranch: "Incomplete branch, every branch in a conditional statement must contain a return statement.", | ||
@@ -912,3 +912,3 @@ incompleteIf: "Incomplete if, it must have an else statement and every branch must contain a return statement.", | ||
}; | ||
const meta$3 = { | ||
const meta$d = { | ||
type: "suggestion", | ||
@@ -920,4 +920,4 @@ docs: { | ||
}, | ||
messages: errorMessages$3, | ||
schema: schema$3, | ||
messages: errorMessages$d, | ||
schema: schema$d, | ||
}; | ||
@@ -976,3 +976,3 @@ function getIfBranchViolations(node) { | ||
} | ||
const rule$3 = createRule(name$3, meta$3, defaultOptions$3, { | ||
const rule$d = createRule(name$d, meta$d, defaultOptions$d, { | ||
IfStatement: checkIfStatement, | ||
@@ -982,9 +982,9 @@ SwitchStatement: checkSwitchStatement, | ||
const name$4 = "no-expression-statement"; | ||
const schema$4 = [ignorePatternOptionSchema]; | ||
const defaultOptions$4 = {}; | ||
const errorMessages$4 = { | ||
const name$c = "no-expression-statement"; | ||
const schema$c = [ignorePatternOptionSchema]; | ||
const defaultOptions$c = {}; | ||
const errorMessages$c = { | ||
generic: "Using expressions to cause side-effects not allowed.", | ||
}; | ||
const meta$4 = { | ||
const meta$c = { | ||
type: "suggestion", | ||
@@ -996,4 +996,4 @@ docs: { | ||
}, | ||
messages: errorMessages$4, | ||
schema: schema$4, | ||
messages: errorMessages$c, | ||
schema: schema$c, | ||
}; | ||
@@ -1006,17 +1006,17 @@ function checkExpressionStatement(node, context) { | ||
} | ||
const rule$4 = createRule(name$4, meta$4, defaultOptions$4, { | ||
const rule$c = createRule(name$c, meta$c, defaultOptions$c, { | ||
ExpressionStatement: checkExpressionStatement, | ||
}); | ||
const name$5 = "no-let"; | ||
const schema$5 = [ | ||
const name$b = "no-let"; | ||
const schema$b = [ | ||
deepMerge.all([allowLocalMutationOptionSchema, ignorePatternOptionSchema]), | ||
]; | ||
const defaultOptions$5 = { | ||
const defaultOptions$b = { | ||
allowLocalMutation: false, | ||
}; | ||
const errorMessages$5 = { | ||
const errorMessages$b = { | ||
generic: "Unexpected let, use const instead.", | ||
}; | ||
const meta$5 = { | ||
const meta$b = { | ||
type: "suggestion", | ||
@@ -1028,5 +1028,5 @@ docs: { | ||
}, | ||
messages: errorMessages$5, | ||
messages: errorMessages$b, | ||
fixable: "code", | ||
schema: schema$5, | ||
schema: schema$b, | ||
}; | ||
@@ -1039,13 +1039,13 @@ function checkVariableDeclaration(node, context) { | ||
} | ||
const rule$5 = createRule(name$5, meta$5, defaultOptions$5, { | ||
const rule$b = createRule(name$b, meta$b, defaultOptions$b, { | ||
VariableDeclaration: checkVariableDeclaration, | ||
}); | ||
const name$6 = "no-loop-statement"; | ||
const schema$6 = []; | ||
const defaultOptions$6 = {}; | ||
const errorMessages$6 = { | ||
const name$a = "no-loop-statement"; | ||
const schema$a = []; | ||
const defaultOptions$a = {}; | ||
const errorMessages$a = { | ||
generic: "Unexpected loop, use map or reduce instead.", | ||
}; | ||
const meta$6 = { | ||
const meta$a = { | ||
type: "suggestion", | ||
@@ -1057,4 +1057,4 @@ docs: { | ||
}, | ||
messages: errorMessages$6, | ||
schema: schema$6, | ||
messages: errorMessages$a, | ||
schema: schema$a, | ||
}; | ||
@@ -1064,3 +1064,3 @@ function checkLoop(node, context) { | ||
} | ||
const rule$6 = createRule(name$6, meta$6, defaultOptions$6, { | ||
const rule$a = createRule(name$a, meta$a, defaultOptions$a, { | ||
ForStatement: checkLoop, | ||
@@ -1073,9 +1073,9 @@ ForInStatement: checkLoop, | ||
const name$7 = "no-method-signature"; | ||
const schema$7 = []; | ||
const defaultOptions$7 = {}; | ||
const errorMessages$7 = { | ||
const name$9 = "no-method-signature"; | ||
const schema$9 = []; | ||
const defaultOptions$9 = {}; | ||
const errorMessages$9 = { | ||
generic: "Method signature is mutable, use property signature with readonly modifier instead.", | ||
}; | ||
const meta$7 = { | ||
const meta$9 = { | ||
type: "suggestion", | ||
@@ -1087,4 +1087,4 @@ docs: { | ||
}, | ||
messages: errorMessages$7, | ||
schema: schema$7, | ||
messages: errorMessages$9, | ||
schema: schema$9, | ||
}; | ||
@@ -1094,3 +1094,3 @@ function checkTSMethodSignature(node, context) { | ||
} | ||
const rule$7 = createRule(name$7, meta$7, defaultOptions$7, { | ||
const rule$9 = createRule(name$9, meta$9, defaultOptions$9, { | ||
TSMethodSignature: checkTSMethodSignature, | ||
@@ -1175,9 +1175,9 @@ }); | ||
const name$9 = "no-promise-reject"; | ||
const schema$9 = []; | ||
const defaultOptions$9 = {}; | ||
const errorMessages$9 = { | ||
const name$7 = "no-promise-reject"; | ||
const schema$7 = []; | ||
const defaultOptions$7 = {}; | ||
const errorMessages$7 = { | ||
generic: "Unexpected reject, return an error instead.", | ||
}; | ||
const meta$9 = { | ||
const meta$7 = { | ||
type: "suggestion", | ||
@@ -1189,6 +1189,6 @@ docs: { | ||
}, | ||
messages: errorMessages$9, | ||
schema: schema$9, | ||
messages: errorMessages$7, | ||
schema: schema$7, | ||
}; | ||
function checkCallExpression$1(node, context) { | ||
function checkCallExpression(node, context) { | ||
return { | ||
@@ -1205,8 +1205,8 @@ context, | ||
} | ||
const rule$9 = createRule(name$9, meta$9, defaultOptions$9, { | ||
CallExpression: checkCallExpression$1, | ||
const rule$7 = createRule(name$7, meta$7, defaultOptions$7, { | ||
CallExpression: checkCallExpression, | ||
}); | ||
const name$a = "no-return-void"; | ||
const schema$a = [ | ||
const name$6 = "no-return-void"; | ||
const schema$6 = [ | ||
{ | ||
@@ -1225,10 +1225,10 @@ type: "object", | ||
]; | ||
const defaultOptions$a = { | ||
const defaultOptions$6 = { | ||
allowNull: true, | ||
allowUndefined: true, | ||
}; | ||
const errorMessages$a = { | ||
const errorMessages$6 = { | ||
generic: "Function must return a value.", | ||
}; | ||
const meta$a = { | ||
const meta$6 = { | ||
type: "suggestion", | ||
@@ -1240,4 +1240,4 @@ docs: { | ||
}, | ||
messages: errorMessages$a, | ||
schema: schema$a, | ||
messages: errorMessages$6, | ||
schema: schema$6, | ||
}; | ||
@@ -1257,3 +1257,3 @@ function checkFunction$1(node, context, options) { | ||
} | ||
const rule$a = createRule(name$a, meta$a, defaultOptions$a, { | ||
const rule$6 = createRule(name$6, meta$6, defaultOptions$6, { | ||
FunctionDeclaration: checkFunction$1, | ||
@@ -1265,9 +1265,9 @@ FunctionExpression: checkFunction$1, | ||
const name$b = "no-this-expression"; | ||
const schema$b = []; | ||
const defaultOptions$b = {}; | ||
const errorMessages$b = { | ||
const name$5 = "no-this-expression"; | ||
const schema$5 = []; | ||
const defaultOptions$5 = {}; | ||
const errorMessages$5 = { | ||
generic: "Unexpected this, use functions not classes.", | ||
}; | ||
const meta$b = { | ||
const meta$5 = { | ||
type: "suggestion", | ||
@@ -1279,4 +1279,4 @@ docs: { | ||
}, | ||
messages: errorMessages$b, | ||
schema: schema$b, | ||
messages: errorMessages$5, | ||
schema: schema$5, | ||
}; | ||
@@ -1286,13 +1286,13 @@ function checkThisExpression(node, context) { | ||
} | ||
const rule$b = createRule(name$b, meta$b, defaultOptions$b, { | ||
const rule$5 = createRule(name$5, meta$5, defaultOptions$5, { | ||
ThisExpression: checkThisExpression, | ||
}); | ||
const name$c = "no-throw-statement"; | ||
const schema$c = []; | ||
const defaultOptions$c = {}; | ||
const errorMessages$c = { | ||
const name$4 = "no-throw-statement"; | ||
const schema$4 = []; | ||
const defaultOptions$4 = {}; | ||
const errorMessages$4 = { | ||
generic: "Unexpected throw, throwing exceptions is not functional.", | ||
}; | ||
const meta$c = { | ||
const meta$4 = { | ||
type: "suggestion", | ||
@@ -1304,4 +1304,4 @@ docs: { | ||
}, | ||
messages: errorMessages$c, | ||
schema: schema$c, | ||
messages: errorMessages$4, | ||
schema: schema$4, | ||
}; | ||
@@ -1311,8 +1311,8 @@ function checkThrowStatement(node, context) { | ||
} | ||
const rule$c = createRule(name$c, meta$c, defaultOptions$c, { | ||
const rule$4 = createRule(name$4, meta$4, defaultOptions$4, { | ||
ThrowStatement: checkThrowStatement, | ||
}); | ||
const name$d = "no-try-statement"; | ||
const schema$d = [ | ||
const name$3 = "no-try-statement"; | ||
const schema$3 = [ | ||
{ | ||
@@ -1331,11 +1331,11 @@ type: "object", | ||
]; | ||
const defaultOptions$d = { | ||
const defaultOptions$3 = { | ||
allowCatch: false, | ||
allowFinally: false, | ||
}; | ||
const errorMessages$d = { | ||
const errorMessages$3 = { | ||
catch: "Unexpected try-catch, this pattern is not functional.", | ||
finally: "Unexpected try-finally, this pattern is not functional.", | ||
}; | ||
const meta$d = { | ||
const meta$3 = { | ||
type: "suggestion", | ||
@@ -1347,4 +1347,4 @@ docs: { | ||
}, | ||
messages: errorMessages$d, | ||
schema: schema$d, | ||
messages: errorMessages$3, | ||
schema: schema$3, | ||
}; | ||
@@ -1361,8 +1361,8 @@ function checkTryStatement(node, context, options) { | ||
} | ||
const rule$d = createRule(name$d, meta$d, defaultOptions$d, { | ||
const rule$3 = createRule(name$3, meta$3, defaultOptions$3, { | ||
TryStatement: checkTryStatement, | ||
}); | ||
const name$e = "prefer-readonly-type"; | ||
const schema$e = [ | ||
const name$2 = "prefer-readonly-type"; | ||
const schema$2 = [ | ||
deepMerge.all([ | ||
@@ -1390,3 +1390,3 @@ allowLocalMutationOptionSchema, | ||
]; | ||
const defaultOptions$e = { | ||
const defaultOptions$2 = { | ||
checkImplicit: false, | ||
@@ -1399,3 +1399,3 @@ ignoreClass: false, | ||
}; | ||
const errorMessages$e = { | ||
const errorMessages$2 = { | ||
array: "Only readonly arrays allowed.", | ||
@@ -1407,3 +1407,3 @@ implicit: "Implicitly a mutable array. Only readonly arrays allowed.", | ||
}; | ||
const meta$e = { | ||
const meta$2 = { | ||
type: "suggestion", | ||
@@ -1415,5 +1415,5 @@ docs: { | ||
}, | ||
messages: errorMessages$e, | ||
messages: errorMessages$2, | ||
fixable: "code", | ||
schema: schema$e, | ||
schema: schema$2, | ||
}; | ||
@@ -1562,3 +1562,3 @@ const mutableToImmutableTypes = new Map([ | ||
} | ||
const rule$e = createRule(name$e, meta$e, defaultOptions$e, { | ||
const rule$2 = createRule(name$2, meta$2, defaultOptions$2, { | ||
ArrowFunctionExpression: checkImplicitType, | ||
@@ -1578,4 +1578,4 @@ ClassProperty: checkProperty, | ||
const name$f = "prefer-tacit"; | ||
const schema$f = [ | ||
const name$1 = "prefer-tacit"; | ||
const schema$1 = [ | ||
deepMerge.all([ | ||
@@ -1611,9 +1611,9 @@ ignorePatternOptionSchema, | ||
]; | ||
const defaultOptions$f = { | ||
const defaultOptions$1 = { | ||
assumeTypes: false, | ||
}; | ||
const errorMessages$f = { | ||
const errorMessages$1 = { | ||
generic: "Potentially unnecessary function wrapper.", | ||
}; | ||
const meta$f = { | ||
const meta$1 = { | ||
type: "suggestion", | ||
@@ -1625,5 +1625,5 @@ docs: { | ||
}, | ||
messages: errorMessages$f, | ||
messages: errorMessages$1, | ||
fixable: "code", | ||
schema: schema$f, | ||
schema: schema$1, | ||
}; | ||
@@ -1707,3 +1707,3 @@ function isCallerViolation(caller, calleeType, context) { | ||
} | ||
function checkFunction$2(node, context, options) { | ||
function checkFunction(node, context, options) { | ||
return { | ||
@@ -1717,15 +1717,17 @@ context, | ||
} | ||
const rule$f = createRule(name$f, meta$f, defaultOptions$f, { | ||
FunctionDeclaration: checkFunction$2, | ||
FunctionExpression: checkFunction$2, | ||
ArrowFunctionExpression: checkFunction$2, | ||
const rule$1 = createRule(name$1, meta$1, defaultOptions$1, { | ||
FunctionDeclaration: checkFunction, | ||
FunctionExpression: checkFunction, | ||
ArrowFunctionExpression: checkFunction, | ||
}); | ||
const name$g = "prefer-type-literal"; | ||
const schema$g = [ignorePatternOptionSchema]; | ||
const defaultOptions$g = {}; | ||
const errorMessages$g = { | ||
const name = "prefer-type-literal"; | ||
const schema = [ignorePatternOptionSchema]; | ||
const defaultOptions = {}; | ||
const errorMessages = { | ||
generic: "Unexpected interface, use a type literal instead.", | ||
}; | ||
const meta$g = { | ||
const meta = { | ||
deprecated: true, | ||
replacedBy: ["@typescript-eslint/consistent-type-definitions"], | ||
type: "suggestion", | ||
@@ -1737,5 +1739,5 @@ docs: { | ||
}, | ||
messages: errorMessages$g, | ||
messages: errorMessages, | ||
fixable: "code", | ||
schema: schema$g, | ||
schema, | ||
}; | ||
@@ -1767,3 +1769,3 @@ function checkInterface(node, context) { | ||
} | ||
const rule$g = createRule(name$g, meta$g, defaultOptions$g, { | ||
const rule = createRule(name, meta, defaultOptions, { | ||
TSInterfaceDeclaration: checkInterface, | ||
@@ -1773,37 +1775,38 @@ }); | ||
const rules = { | ||
[name$g]: rule$g, | ||
[name$f]: rule$f, | ||
[name$e]: rule$e, | ||
[name$d]: rule$d, | ||
[name$c]: rule$c, | ||
[name$b]: rule$b, | ||
[name$a]: rule$a, | ||
[name$9]: rule$9, | ||
[name$8]: rule$8, | ||
[name$7]: rule$7, | ||
[name$6]: rule$6, | ||
[name$5]: rule$5, | ||
[name$4]: rule$4, | ||
[name$3]: rule$3, | ||
[name$2]: rule$2, | ||
[name$1]: rule$1, | ||
[name]: rule, | ||
[name$1]: rule$1, | ||
[name$2]: rule$2, | ||
[name$3]: rule$3, | ||
[name$4]: rule$4, | ||
[name$5]: rule$5, | ||
[name$6]: rule$6, | ||
[name$7]: rule$7, | ||
[name$8]: rule$8, | ||
[name$9]: rule$9, | ||
[name$a]: rule$a, | ||
[name$b]: rule$b, | ||
[name$c]: rule$c, | ||
[name$d]: rule$d, | ||
[name$e]: rule$e, | ||
[name$f]: rule$f, | ||
[name$g]: rule$g, | ||
}; | ||
const config$a = { | ||
const config = { | ||
rules, | ||
configs: { | ||
all: config, | ||
recommended: config$7, | ||
"external-recommended": config$2, | ||
lite: config$8, | ||
"no-mutations": config$3, | ||
"no-exceptions": config$4, | ||
all: config$a, | ||
recommended: config$3, | ||
"external-recommended": config$8, | ||
lite: config$2, | ||
"no-mutations": config$7, | ||
"no-exceptions": config$6, | ||
"no-object-orientation": config$5, | ||
"no-statements": config$6, | ||
currying: config$1, | ||
stylitic: config$9, | ||
"no-statements": config$4, | ||
currying: config$9, | ||
stylitic: config$1, | ||
stylistic: config$1, | ||
}, | ||
}; | ||
module.exports = config$a; | ||
module.exports = config; |
{ | ||
"name": "eslint-plugin-functional", | ||
"version": "3.2.1", | ||
"version": "3.2.2", | ||
"description": "ESLint rules to disable mutation and promote fp in TypeScript.", | ||
@@ -75,6 +75,6 @@ "keywords": [ | ||
"@types/eslint": "^7.2.6", | ||
"@types/estree": "^0.0.45", | ||
"@types/estree": "^0.0.46", | ||
"@types/glob": "^7.1.1", | ||
"@types/jest": "^26.0.19", | ||
"@types/node": "14.14.12", | ||
"@types/node": "15.0.1", | ||
"@typescript-eslint/eslint-plugin": "^4.9.1", | ||
@@ -89,12 +89,12 @@ "@typescript-eslint/parser": "^4.9.1", | ||
"eslint": "^7.15.0", | ||
"eslint-config-prettier": "^7.0.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-eslint-plugin": "^2.2.0", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-jest": "^24.1.3", | ||
"eslint-plugin-jsdoc": "^30.7.8", | ||
"eslint-plugin-jsdoc": "^32.3.0", | ||
"eslint-plugin-prettier": "^3.2.0", | ||
"glob": "^7.1.6", | ||
"husky": "^4.3.5", | ||
"husky": "^6.0.0", | ||
"jest": "^26.6.3", | ||
"json-schema": "^0.2.5", | ||
"json-schema": "^0.3.0", | ||
"lint-staged": "^10.5.3", | ||
@@ -101,0 +101,0 @@ "prettier": "^2.2.1", |
@@ -18,3 +18,3 @@ <div align="center"> | ||
> :wave: If you previously used the rules in [tslint-immutable](https://www.npmjs.com/package/tslint-immutable), this package is the eslint version of those rules. Please see the [migration guide](docs/user-guide/migrating-from-tslint.md) for how to migrate. | ||
> :wave: If you previously used the rules in [tslint-immutable](https://www.npmjs.com/package/tslint-immutable), this package is the ESLint version of those rules. Please see the [migration guide](docs/user-guide/migrating-from-tslint.md) for how to migrate. | ||
@@ -28,3 +28,3 @@ ## Features | ||
- [Currying](#currying) | ||
- [Stylitic](#stylitic) | ||
- [Stylistic](#stylistic) | ||
@@ -41,3 +41,3 @@ ### No mutations | ||
In functional programming everything is an expression that produces a value. Javascript has a lot of syntax that is just statements that does not produce a value. That syntax has to be disabled to promote a functional style. | ||
In functional programming everything is an expression that produces a value. JavaScript has a lot of syntax that is just statements that does not produce a value. That syntax has to be disabled to promote a functional style. | ||
@@ -50,5 +50,5 @@ ### No exceptions | ||
Javascript functions support syntax that is not compatible with curried functions. To enable currying this syntax has to be disabled. | ||
JavaScript functions support syntax that is not compatible with curried functions. To enable currying this syntax has to be disabled. | ||
### Stylitic | ||
### Stylistic | ||
@@ -73,3 +73,3 @@ Make things look nicer (in our opinion). | ||
To use this plugin with TypeScript, a TypeScript parser for eslint is needed. | ||
To use this plugin with TypeScript, a TypeScript parser for ESLint is needed. | ||
We recommend [@typescript-eslint/parser](https://www.npmjs.com/package/@typescript-eslint/parser). | ||
@@ -108,3 +108,3 @@ | ||
"plugin:functional/recommended", | ||
"plugin:functional/stylitic" | ||
"plugin:functional/stylistic" | ||
] | ||
@@ -116,3 +116,3 @@ } | ||
Add `@typescript-eslint/parser` to the "parser" filed in your `.eslintrc` configuration file. | ||
Add `@typescript-eslint/parser` to the "parser" filed in your `.eslintrc` configuration file. | ||
To use type information, you will need to specify a path to your `tsconfig.json` file in the "project" property of "parserOptions". | ||
@@ -153,3 +153,3 @@ | ||
"plugin:functional/recommended", | ||
"plugin:functional/stylitic" | ||
"plugin:functional/stylistic" | ||
] | ||
@@ -175,3 +175,3 @@ } | ||
- **Currying** (plugin:functional/currying) | ||
- **Stylitic** (plugin:functional/stylitic) | ||
- **Stylistic** (plugin:functional/stylistic) | ||
@@ -194,3 +194,3 @@ Other: | ||
| :wrench: | Fixable<br><sub><sup>Problems found by this rule are potentially fixable with the `--fix` option.</sup></sub> | | ||
| :thought_balloon: | Only Avaliable for TypeScript<br><sub><sup>The rule either requires Type Information or only works with TypeScript syntax.</sup></sub> | | ||
| :thought_balloon: | Only Available for TypeScript<br><sub><sup>The rule either requires Type Information or only works with TypeScript syntax.</sup></sub> | | ||
| :blue_heart: | Works better with TypeScript<br><sub><sup>Type Information will be used if available making the rule work in more cases.</sup></sub> | | ||
@@ -249,7 +249,7 @@ | ||
### Stylitic Rules | ||
### Stylistic Rules | ||
:see_no_evil: = `stylitic` Ruleset. | ||
:see_no_evil: = `stylistic` Ruleset. | ||
| Name | Description | <span title="Stylitic">:see_no_evil:</span> | <span title="Lite">:hear_no_evil:</span> | <span title="Recommended">:speak_no_evil:</span> | :wrench: | :blue_heart: | | ||
| Name | Description | <span title="Stylistic">:see_no_evil:</span> | <span title="Lite">:hear_no_evil:</span> | <span title="Recommended">:speak_no_evil:</span> | :wrench: | :blue_heart: | | ||
| ---------------------------------------------- | ----------------------- | :-----------------------------------------: | :--------------------------------------: | :----------------------------------------------: | :------: | :----------: | | ||
@@ -296,5 +296,5 @@ | [`prefer-tacit`](./docs/rules/prefer-tacit.md) | Tacit/Point-Free style. | :heavy_check_mark: | | | :wrench: | :blue_heart: | | ||
To learn about eslint plugin development see the [relevant section](https://eslint.org/docs/developer-guide/working-with-plugins) of the eslint docs. You can also checkout the [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint) repo which has some more information specific to typescript. | ||
To learn about ESLint plugin development see the [relevant section](https://eslint.org/docs/developer-guide/working-with-plugins) of the ESLint docs. You can also checkout the [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint) repo which has some more information specific to TypeScript. | ||
In order to know which AST nodes are created for a snippet of TypeScript code you can use [ast explorer](https://astexplorer.net/) with options JavaScript and @typescript-eslint/parser. | ||
In order to know which AST nodes are created for a snippet of TypeScript code you can use [AST explorer](https://astexplorer.net/) with options JavaScript and @typescript-eslint/parser. | ||
@@ -301,0 +301,0 @@ ## How to publish |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
155259
3408