Skip to content

Instantly share code, notes, and snippets.

@natterstefan
Last active September 20, 2021 19:43
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natterstefan/3121af83f5f98ee05311d85766ed0d67 to your computer and use it in GitHub Desktop.
Save natterstefan/3121af83f5f98ee05311d85766ed0d67 to your computer and use it in GitHub Desktop.
.eslintrc Example
{
"extends": "airbnb",
"parser": "babel-eslint",
"env": {
"browser": false,
"node": true,
"es6": true,
"mocha": false
},
"parserOptions": {
"sourceType": "module"
},
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"modules": true,
"spread": true,
"globalReturn": true,
},
"rules": {
"valid-jsdoc": ["error", {
"requireReturn": true,
"requireReturnType": true,
"requireParamDescription": true,
"requireReturnDescription": true,
"preferType": {
"String": "string",
"object": "Object",
}
}],
"require-jsdoc": ["error", {
"require": {
"FunctionDeclaration": true,
"MethodDefinition": true,
"ClassDeclaration": true
}
}],
"no-var": 1,
"no-eval": "error",
"indent": ["error", 2],
"quotes": ["error", "single"],
"no-console": ["error", { "allow": ["warn", "info"] }],
"space-before-function-paren": ["error", "never"],
"padded-blocks": ["error", "always"],
"prefer-arrow-callback": [0, { "allowNamedFunctions": true }],
"func-names": ["error", "never"],
"no-use-before-define": [
"error", {
"functions": true,
"classes": true
}
],
"max-nested-callbacks": [
"error",
5
],
}
}
/**
* Send an onboarding message when a user activates the bot
*
* @module facebookbot-standalone/components
*/
module.exports = function(controller) {
/**
* this is triggered when a user clicks the send-to-messenger plugin
*/
controller.on('facebook_optin', function(bot, message) {
bot.replyWithTyping(message, 'Hello, nice to meet you!');
});
controller.hears(['GET_STARTED_PAYLOAD'], 'message_received,facebook_postback,facebook_account_linking', function(bot, message) {
bot.replyWithTyping(message, 'Hello, nice to meet you!');
});
};
{
"name": "xxxx",
"version": "0.0.1",
"description": "xxxx",
"main": "server.js",
"scripts": {
"start": "node server.js",
"express": "node server.js",
"documentation": "grunt documentation"
},
"devDependencies": {
"babel-eslint": "7.2.3",
"eslint": "3.19.0",
"eslint-config-airbnb": "14.1.0",
"eslint-plugin-import": "2.2.0",
"eslint-plugin-jsx-a11y": "4.0.0",
"eslint-plugin-react": "6.10.3",
"grunt": "1.0.1",
"grunt-contrib-cssmin": "2.1.0",
"grunt-contrib-uglify": "2.3.0",
"grunt-contrib-watch": "1.0.0",
"grunt-http-server": "2.0.0",
"grunt-jsdoc": "2.1.0",
"ink-docstrap": "1.3.0",
"jit-grunt": "0.10.0",
"time-grunt": "1.4.0"
},
"repository": {
"type": "git",
"url": "xxxx"
},
"bugs": {
"url": "xxxx"
},
"homepage": "xxxx",
"keywords": [
"bot"
],
"author": "xxxx",
"license": "ISC"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment