Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

abandon Ramda-style currying in favour of simple currying #520

Merged
merged 1 commit into from
Apr 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"root": true,
"extends": ["./node_modules/sanctuary-style/eslint-es3.json"]
"extends": ["./eslint/es3.js"]
}
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"types"
],
"dependencies": {
"sanctuary-def": "0.14.0",
"sanctuary-def": "0.15.0",
"sanctuary-type-classes": "8.1.1",
"sanctuary-type-identifiers": "2.0.1"
},
Expand Down
12 changes: 12 additions & 0 deletions eslint/es3.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use strict';

module.exports = {
root: true,
extends: ['../node_modules/sanctuary-style/eslint-es3.json'],
rules: {
'func-call-spacing': ['error', 'always', {allowNewlines: true}],
'indent': require ('./rules/indent'),
'no-extra-parens': ['off'],
'no-unexpected-multiline': ['off'],
},
};
41 changes: 41 additions & 0 deletions eslint/es6.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
'use strict';

module.exports = {
root: true,
extends: ['../node_modules/sanctuary-style/eslint-es6.json'],
env: {node: true},
rules: {
'func-call-spacing': ['error', 'always', {allowNewlines: true}],
'indent': require ('./rules/indent'),
'no-extra-parens': ['off'],
'no-unexpected-multiline': ['off'],
},
overrides: [
{
files: ['*.md'],
plugins: ['markdown'],
globals: {
$: false,
Cons: false,
Just: false,
Left: false,
Nil: false,
Nothing: false,
R: false,
Right: false,
S: false,
Sum: false,
},
rules: {
'array-bracket-spacing': ['off'],
'indent': ['off'],
'no-eval': ['off'],
'no-extra-semi': ['off'],
'no-unused-vars': ['off'],
'object-shorthand': ['error', 'always'],
'prefer-template': ['off'],
'strict': ['off'],
},
},
],
};
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file allows us to verify that doctests and code snippets follow our desired formatting rules.

13 changes: 13 additions & 0 deletions eslint/rules/indent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict';

const common = require ('sanctuary-style/eslint-common.json');


const indent = (JSON.parse (JSON.stringify (common))).rules['indent'];
indent[2].ignoredNodes.push (
'CallExpression',
'CallExpression > *',
'CallExpression > ArrowFunctionExpression ArrowFunctionExpression > *',
'CallExpression > FunctionExpression > BlockStatement'
);
module.exports = indent;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ESLint does not like this indentation:

f (x)
  (y)
  (z)

Rather than disable the indent rule entirely, we can add exceptions for problematic cases.

Loading