├── .editorconfig ├── .eslintrc.js ├── .eslintrc.prepublish.js ├── .github └── workflows │ └── publish.yml ├── .gitignore ├── .prettierrc.js ├── .vscode └── extensions.json ├── CODE_OF_CONDUCT.md ├── LICENSE.md ├── README.md ├── _examples └── rss_to_slack.json ├── gulpfile.js ├── index.js ├── nodes └── RssFeedTrigger │ └── RssFeedTrigger.node.ts ├── package-lock.json ├── package.json ├── tsconfig.json └── tslint.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = tab 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [package.json] 12 | indent_style = space 13 | indent_size = 2 14 | 15 | [*.md] 16 | trim_trailing_whitespace = false 17 | 18 | [*.yml] 19 | indent_style = space 20 | indent_size = 2 21 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | 4 | env: { 5 | browser: true, 6 | es6: true, 7 | node: true, 8 | }, 9 | 10 | parser: '@typescript-eslint/parser', 11 | parserOptions: { 12 | project: ['./tsconfig.json'], 13 | sourceType: 'module', 14 | extraFileExtensions: ['.json'], 15 | }, 16 | ignorePatterns: [ 17 | '.eslintrc.js', 18 | '**/*.js', 19 | '**/node_modules/**', 20 | '**/dist/**', 21 | ], 22 | 23 | overrides: [ 24 | { 25 | files: ['package.json'], 26 | plugins: ['eslint-plugin-n8n-nodes-base'], 27 | extends: ['plugin:n8n-nodes-base/community'], 28 | rules: { 29 | 'n8n-nodes-base/community-package-json-name-still-default': 'off', 30 | } 31 | }, 32 | { 33 | files: ['./credentials/**/*.ts'], 34 | plugins: ['eslint-plugin-n8n-nodes-base'], 35 | extends: ['plugin:n8n-nodes-base/credentials'], 36 | rules: { 37 | 'n8n-nodes-base/cred-class-field-documentation-url-missing': 'off', 38 | 'n8n-nodes-base/cred-class-field-documentation-url-miscased': 'off', 39 | }, 40 | }, 41 | { 42 | files: ['./nodes/**/*.ts'], 43 | plugins: ['eslint-plugin-n8n-nodes-base'], 44 | extends: ['plugin:n8n-nodes-base/nodes'], 45 | rules: { 46 | 'n8n-nodes-base/node-execute-block-missing-continue-on-fail': 'off', 47 | 'n8n-nodes-base/node-resource-description-filename-against-convention': 'off', 48 | 'n8n-nodes-base/node-param-fixed-collection-type-unsorted-items': 'off', 49 | 'n8n-nodes-base/node-execute-block-operation-missing-singular-pairing': 'off', 50 | 'n8n-nodes-base/node-execute-block-operation-missing-plural-pairing': 'off', 51 | }, 52 | }, 53 | ], 54 | }; 55 | -------------------------------------------------------------------------------- /.eslintrc.prepublish.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: "./.eslintrc.js", 3 | overrides: [ 4 | { 5 | files: ['package.json'], 6 | plugins: ['eslint-plugin-n8n-nodes-base'], 7 | rules: { 8 | 'n8n-nodes-base/community-package-json-name-still-default': 'error', 9 | }, 10 | }, 11 | ], 12 | }; 13 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish Package 2 | on: 3 | release: 4 | types: [created] 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v3 10 | - uses: actions/setup-node@v3 11 | with: 12 | node-version: '16.x' 13 | registry-url: 'https://registry.npmjs.org' 14 | - run: npm ci 15 | - run: npm run build 16 | - run: npm publish 17 | env: 18 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | .tmp 4 | tmp 5 | dist 6 | npm-debug.log* 7 | yarn.lock 8 | .vscode/launch.json 9 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | /** 3 | * https://prettier.io/docs/en/options.html#semicolons 4 | */ 5 | semi: true, 6 | 7 | /** 8 | * https://prettier.io/docs/en/options.html#trailing-commas 9 | */ 10 | trailingComma: 'all', 11 | 12 | /** 13 | * https://prettier.io/docs/en/options.html#bracket-spacing 14 | */ 15 | bracketSpacing: true, 16 | 17 | /** 18 | * https://prettier.io/docs/en/options.html#tabs 19 | */ 20 | useTabs: true, 21 | 22 | /** 23 | * https://prettier.io/docs/en/options.html#tab-width 24 | */ 25 | tabWidth: 2, 26 | 27 | /** 28 | * https://prettier.io/docs/en/options.html#arrow-function-parentheses 29 | */ 30 | arrowParens: 'always', 31 | 32 | /** 33 | * https://prettier.io/docs/en/options.html#quotes 34 | */ 35 | singleQuote: true, 36 | 37 | /** 38 | * https://prettier.io/docs/en/options.html#quote-props 39 | */ 40 | quoteProps: 'as-needed', 41 | 42 | /** 43 | * https://prettier.io/docs/en/options.html#end-of-line 44 | */ 45 | endOfLine: 'lf', 46 | 47 | /** 48 | * https://prettier.io/docs/en/options.html#print-width 49 | */ 50 | printWidth: 100, 51 | }; 52 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint", 4 | "EditorConfig.EditorConfig", 5 | "esbenp.prettier-vscode", 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at jan@n8n.io. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2022 n8n 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # n8n-nodes-rss-feed-trigger 2 | 3 | This is an n8n community node. It lets you use an RSS Feed to trigger your workflows. For testing https://lorem-rss.herokuapp.com/feed can be used. 4 | 5 | This trigger node will get any items that have a published date that is after the date of the last run of the trigger. 6 | 7 | [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform. 8 | 9 | [Installation](#installation) 10 | [Version history](#version-history) 11 | 12 | ## Installation 13 | 14 | Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation. 15 | 16 | ## Resources 17 | 18 | * [n8n community nodes documentation](https://docs.n8n.io/integrations/community-nodes/) 19 | * Example Workflows can be found in the _examples folder 20 | * rss_to_slack.json - This posts updates from wtf1.com to Slack, It has a function node to build the Slack message but also has an option to use the [Document Generator](https://www.npmjs.com/package/n8n-nodes-document-generator) node 21 | 22 | ## Version history 23 | 24 | 0.1.3 - Bumped versions and removed error output to match standard nodes 25 | 0.1.2 - Fixed activation issue 26 | 0.1.1 - When running manually it will return the first item for the feed 27 | 0.1.0 - Initial Release 28 | -------------------------------------------------------------------------------- /_examples/rss_to_slack.json: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": [ 3 | { 4 | "parameters": {}, 5 | "id": "8d9f1bf4-5732-461f-a902-78e9cdd440b1", 6 | "name": "Start", 7 | "type": "n8n-nodes-base.start", 8 | "typeVersion": 1, 9 | "position": [ 10 | 220, 11 | 220 12 | ], 13 | "disabled": true 14 | }, 15 | { 16 | "parameters": { 17 | "pollTimes": { 18 | "item": [ 19 | { 20 | "mode": "everyX", 21 | "value": 30, 22 | "unit": "minutes" 23 | } 24 | ] 25 | }, 26 | "feedUrl": "https://wtf1.com/feed/" 27 | }, 28 | "id": "f806d599-a54f-4962-bb54-cef44974aff2", 29 | "name": "RSS Feed Trigger", 30 | "type": "n8n-nodes-rss-feed-trigger.rssFeedTrigger", 31 | "typeVersion": 1, 32 | "position": [ 33 | 480, 34 | 140 35 | ] 36 | }, 37 | { 38 | "parameters": { 39 | "oneTemplate": true, 40 | "template": "*:new: WTF1 Updates :new:*\n\n{{#each items}}\n*<{{link}}|{{title}}>* - {{pubDate}}\n{{contentSnippet}}\n\n\n{{/each}}" 41 | }, 42 | "id": "93149dd0-f7a8-4a66-9c6d-8bc41aa15502", 43 | "name": "DocumentGenerator", 44 | "type": "n8n-nodes-document-generator.DocumentGenerator", 45 | "typeVersion": 1, 46 | "position": [ 47 | 700, 48 | 260 49 | ], 50 | "disabled": true 51 | }, 52 | { 53 | "parameters": { 54 | "channel": "rss-feeds", 55 | "text": "={{ $json[\"text\"] }}", 56 | "otherOptions": { 57 | "mrkdwn": true, 58 | "unfurl_links": false, 59 | "unfurl_media": false 60 | }, 61 | "attachments": [] 62 | }, 63 | "id": "2d98a964-f444-4c07-bc58-440098d83ba9", 64 | "name": "Slack", 65 | "type": "n8n-nodes-base.slack", 66 | "typeVersion": 1, 67 | "position": [ 68 | 900, 69 | 140 70 | ], 71 | "credentials": { 72 | "slackApi": { 73 | "id": "39", 74 | "name": "Slack Access Token" 75 | } 76 | } 77 | }, 78 | { 79 | "parameters": { 80 | "functionCode": "// Create our Slack message\nlet text = \"*:new: WTF1 Updates :new:*\\n\\n\";\n\n// Loop the input items\nfor (item of items) {\n text += `*<${item.json.link}|${item.json.title}>* - ${item.json.pubDate}\\n${item.json.contentSnippet}\\n\\n`;\n}\n\n// Return our message\nreturn [{json: {text}}];" 81 | }, 82 | "name": "Build our message", 83 | "type": "n8n-nodes-base.function", 84 | "position": [ 85 | 700, 86 | 20 87 | ], 88 | "typeVersion": 1, 89 | "id": "b1827057-fee9-4100-b73a-eba8711baa9a" 90 | }, 91 | { 92 | "parameters": { 93 | "content": "This workflow will post updates from wtf1.com to Slack every 30 minutes.\n\nIf you have the [Document Generator](https://www.npmjs.com/package/n8n-nodes-document-generator) node installed you can connect that instead of using the function node.", 94 | "height": 308, 95 | "width": 332 96 | }, 97 | "id": "67264483-e3cc-4306-87be-29dc75dd1d5d", 98 | "name": "Note", 99 | "type": "n8n-nodes-base.stickyNote", 100 | "typeVersion": 1, 101 | "position": [ 102 | 128, 103 | 60 104 | ] 105 | } 106 | ], 107 | "connections": { 108 | "RSS Feed Trigger": { 109 | "main": [ 110 | [ 111 | { 112 | "node": "Build our message", 113 | "type": "main", 114 | "index": 0 115 | } 116 | ] 117 | ] 118 | }, 119 | "Build our message": { 120 | "main": [ 121 | [ 122 | { 123 | "node": "Slack", 124 | "type": "main", 125 | "index": 0 126 | } 127 | ] 128 | ] 129 | } 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { task, src, dest } = require('gulp'); 3 | 4 | task('build:icons', copyIcons); 5 | 6 | function copyIcons() { 7 | const nodeSource = path.resolve('nodes', '**', '*.{png,svg}'); 8 | const nodeDestination = path.resolve('dist', 'nodes'); 9 | 10 | src(nodeSource).pipe(dest(nodeDestination)); 11 | 12 | const credSource = path.resolve('credentials', '**', '*.{png,svg}'); 13 | const credDestination = path.resolve('dist', 'credentials'); 14 | 15 | return src(credSource).pipe(dest(credDestination)); 16 | } 17 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Joffcom/n8n-nodes-rss-feed-trigger/42ca92e526639a65ef29d9cf618b5a03978a22e4/index.js -------------------------------------------------------------------------------- /nodes/RssFeedTrigger/RssFeedTrigger.node.ts: -------------------------------------------------------------------------------- 1 | import { 2 | IDataObject, 3 | INodeExecutionData, 4 | INodeType, 5 | INodeTypeDescription, 6 | IPollFunctions, 7 | NodeOperationError, 8 | } from 'n8n-workflow'; 9 | import Parser from 'rss-parser'; 10 | import moment from 'moment'; 11 | 12 | export class RssFeedTrigger implements INodeType { 13 | description : INodeTypeDescription = { 14 | displayName: 'RSS Feed Trigger', 15 | name: 'rssFeedTrigger', 16 | icon: 'fa:rss', 17 | group: ['trigger'], 18 | version: 1, 19 | description: 'Starts a workflow when an RSS feed is updated', 20 | subtitle: '={{$parameter["event"]}}', 21 | defaults : { 22 | name: 'RSS Feed Trigger', 23 | }, 24 | polling: true, 25 | inputs: [], 26 | outputs: ['main'], 27 | properties: [ 28 | { 29 | displayName: 'Feed URL', 30 | name: 'feedUrl', 31 | type: 'string', 32 | default: 'https://blog.n8n.io/rss/', 33 | required: true, 34 | description: 'URL of the RSS feed to poll', 35 | }, 36 | ], 37 | }; 38 | 39 | async poll(this: IPollFunctions): Promise { 40 | const pollData = this.getWorkflowStaticData('node'); 41 | const feedUrl = this.getNodeParameter('feedUrl') as string; 42 | 43 | const now = moment().utc().format(); 44 | const startDate = (pollData.lastTimeChecked as string) || now; 45 | 46 | const endDate = now; 47 | 48 | try { 49 | if (!feedUrl) { 50 | throw new NodeOperationError(this.getNode(), 'The parameter "URL" has to be set!'); 51 | } 52 | 53 | const parser = new Parser(); 54 | 55 | let feed: Parser.Output; 56 | try { 57 | feed = await parser.parseURL(feedUrl); 58 | } catch (error) { 59 | if (error.code === 'ECONNREFUSED') { 60 | throw new NodeOperationError( 61 | this.getNode(), 62 | `It was not possible to connect to the URL. Please make sure the URL "${feedUrl}" it is valid!`, 63 | ); 64 | } 65 | 66 | throw new NodeOperationError(this.getNode(), error); 67 | } 68 | 69 | const returnData: IDataObject[] = []; 70 | 71 | // For now we just take the items and ignore everything else 72 | if (feed.items) { 73 | // If test mode just return the first item 74 | if (this.getMode() === 'manual') { 75 | return [this.helpers.returnJsonArray(feed.items[0])]; 76 | } 77 | feed.items.forEach((item) => { 78 | // @ts-ignore 79 | if (Date.parse(item.isoDate) >= Date.parse(startDate)) { 80 | // @ts-ignore 81 | returnData.push(item); 82 | } 83 | }); 84 | } 85 | pollData.lastTimeChecked = endDate; 86 | if (Array.isArray(returnData) && returnData.length !== 0) { 87 | return [this.helpers.returnJsonArray(returnData)]; 88 | } 89 | return null; 90 | } catch (error) { 91 | return null; 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "n8n-nodes-rss-feed-trigger", 3 | "version": "0.1.3", 4 | "description": "Trigger n8n workflows from an RSS Feed", 5 | "keywords": [ 6 | "n8n-community-node-package", 7 | "rss" 8 | ], 9 | "license": "MIT", 10 | "homepage": "https://joffcom.net", 11 | "author": { 12 | "name": "Jonathan", 13 | "email": "jonathan@joffcom.net" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/joffcom/n8n-nodes-rss-feed-trigger.git" 18 | }, 19 | "main": "index.js", 20 | "scripts": { 21 | "build": "tsc && gulp build:icons", 22 | "dev": "tsc --watch", 23 | "format": "prettier nodes credentials --write", 24 | "lint": "tslint -p tsconfig.json -c tslint.json && eslint nodes package.json", 25 | "lintfix": "tslint --fix -p tsconfig.json -c tslint.json && eslint nodes package.json --fix", 26 | "prepublishOnly": "npm run build && npm run lint -c .eslintrc.prepublish.js nodes package.json" 27 | }, 28 | "files": [ 29 | "dist" 30 | ], 31 | "n8n": { 32 | "n8nNodesApiVersion": 1, 33 | "nodes": [ 34 | "dist/nodes/RssFeedTrigger/RssFeedTrigger.node.js" 35 | ] 36 | }, 37 | "devDependencies": { 38 | "@types/express": "^4.17.6", 39 | "@types/request-promise-native": "~1.0.15", 40 | "@types/xml2js": "^0.4.11", 41 | "@typescript-eslint/parser": "^5.29.0", 42 | "eslint-plugin-n8n-nodes-base": "^1.11.0", 43 | "gulp": "^4.0.2", 44 | "n8n-core": "^0.142.1", 45 | "n8n-workflow": "^0.124.1", 46 | "prettier": "^2.7.1", 47 | "tslint": "^6.1.2", 48 | "typescript": "~4.6.0" 49 | }, 50 | "dependencies": { 51 | "moment": "^2.29.4", 52 | "rss-parser": "^3.12.0" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": [ 4 | "es2017", 5 | "es2019" 6 | ], 7 | "types": [ 8 | "node", 9 | ], 10 | "module": "commonjs", 11 | "noImplicitAny": true, 12 | "removeComments": true, 13 | "strictNullChecks": true, 14 | "strict": true, 15 | "preserveConstEnums": true, 16 | "resolveJsonModule": true, 17 | "declaration": true, 18 | "outDir": "./dist/", 19 | "target": "es2019", 20 | "sourceMap": true, 21 | "esModuleInterop": true, 22 | "useUnknownInCatchVariables": false, 23 | }, 24 | "include": [ 25 | "credentials/**/*", 26 | "nodes/**/*", 27 | "nodes/**/*.json", 28 | "package.json", 29 | ], 30 | } 31 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "linterOptions": { 3 | "exclude": [ 4 | "node_modules/**/*" 5 | ] 6 | }, 7 | "defaultSeverity": "error", 8 | "jsRules": {}, 9 | "rules": { 10 | "array-type": [ 11 | true, 12 | "array-simple" 13 | ], 14 | "arrow-return-shorthand": true, 15 | "ban": [ 16 | true, 17 | { 18 | "name": "Array", 19 | "message": "tsstyle#array-constructor" 20 | } 21 | ], 22 | "ban-types": [ 23 | true, 24 | [ 25 | "Object", 26 | "Use {} instead." 27 | ], 28 | [ 29 | "String", 30 | "Use 'string' instead." 31 | ], 32 | [ 33 | "Number", 34 | "Use 'number' instead." 35 | ], 36 | [ 37 | "Boolean", 38 | "Use 'boolean' instead." 39 | ] 40 | ], 41 | "class-name": true, 42 | "curly": [ 43 | true, 44 | "ignore-same-line" 45 | ], 46 | "forin": true, 47 | "jsdoc-format": true, 48 | "label-position": true, 49 | "indent": [ 50 | true, 51 | "tabs", 52 | 2 53 | ], 54 | "member-access": [ 55 | true, 56 | "no-public" 57 | ], 58 | "new-parens": true, 59 | "no-angle-bracket-type-assertion": true, 60 | "no-any": true, 61 | "no-arg": true, 62 | "no-conditional-assignment": true, 63 | "no-construct": true, 64 | "no-debugger": true, 65 | "no-default-export": true, 66 | "no-duplicate-variable": true, 67 | "no-inferrable-types": true, 68 | "ordered-imports": [ 69 | true, 70 | { 71 | "import-sources-order": "any", 72 | "named-imports-order": "case-insensitive" 73 | } 74 | ], 75 | "no-namespace": [ 76 | true, 77 | "allow-declarations" 78 | ], 79 | "no-reference": true, 80 | "no-string-throw": true, 81 | "no-unused-expression": true, 82 | "no-var-keyword": true, 83 | "object-literal-shorthand": true, 84 | "only-arrow-functions": [ 85 | true, 86 | "allow-declarations", 87 | "allow-named-functions" 88 | ], 89 | "prefer-const": true, 90 | "radix": true, 91 | "semicolon": [ 92 | true, 93 | "always", 94 | "ignore-bound-class-methods" 95 | ], 96 | "switch-default": true, 97 | "trailing-comma": [ 98 | true, 99 | { 100 | "multiline": { 101 | "objects": "always", 102 | "arrays": "always", 103 | "functions": "always", 104 | "typeLiterals": "ignore" 105 | }, 106 | "esSpecCompliant": true 107 | } 108 | ], 109 | "triple-equals": [ 110 | true, 111 | "allow-null-check" 112 | ], 113 | "use-isnan": true, 114 | "quotes": [ 115 | "error", 116 | "single" 117 | ], 118 | "variable-name": [ 119 | true, 120 | "check-format", 121 | "ban-keywords", 122 | "allow-leading-underscore", 123 | "allow-trailing-underscore" 124 | ] 125 | }, 126 | "rulesDirectory": [] 127 | } 128 | --------------------------------------------------------------------------------