diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..89a05ba --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: build + +on: + push: + branches: + - master + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + + - name: Install npm dependencies + run: yarn install + + - name: Run automated release process with semantic-release + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + yarn add --dev semantic-release@16.0.0-beta.26 @semantic-release/changelog@3 @semantic-release/exec@3.4.0-beta.2 @semantic-release/git@7.1.0-beta.3 + ./node_modules/.bin/semantic-release diff --git a/README.md b/README.md new file mode 100644 index 0000000..994cbc7 --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +# ESLint shareable config for the [SweetAlert2](https://github.com/sweetalert2/sweetalert2) JS/TS coding style + +[![npm version](https://img.shields.io/npm/v/@sweetalert2/eslint-config.svg)](https://www.npmjs.com/package/@sweetalert2/eslint-config) +[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/sweetalert2/eslint-config/blob/master/CHANGELOG.md) +[![Greenkeeper badge](https://badges.greenkeeper.io/sweetalert2/eslint-config.svg)](https://greenkeeper.io/) + +> ESLint [shareable config](http://eslint.org/docs/developer-guide/shareable-configs.html) for the [SweetAlert2](https://github.com/sweetalert2/sweetalert2) JS/TS coding style + + +## Installation + +``` +$ npm install --save-dev @sweetalert2/eslint-config +``` + +or + +``` +$ yarn add --dev @sweetalert2/eslint-config +``` + + +## Usage + +Once the `@sweetalert2/eslint-config` package is installed, you can use it by specifying `sweetalert2` in the [`extends`](http://eslint.org/docs/user-guide/configuring#extending-configuration-files) section of your [ESLint configuration](http://eslint.org/docs/user-guide/configuring). + +```js +{ + "extends": "@sweetalert2/eslint-config", + "rules": { + // Additional, per-project rules... + } +} +``` diff --git a/index.js b/index.js new file mode 100644 index 0000000..cd13eda --- /dev/null +++ b/index.js @@ -0,0 +1,27 @@ +module.exports = { + parser: '@typescript-eslint/parser', + env: { + browser: true, + node: true, + commonjs: true, + es6: true + }, + extends: [ + 'standard', + 'plugin:@typescript-eslint/recommended' + ], + rules: { + '@typescript-eslint/explicit-function-return-type': 0, + '@typescript-eslint/indent': ['error', 2], + '@typescript-eslint/no-this-alias': 0, + '@typescript-eslint/no-use-before-define': 0, + '@typescript-eslint/no-var-requires': 0, + '@typescript-eslint/no-empty-interface': 0, + '@typescript-eslint/no-explicit-any': 0, + 'comma-dangle': 0, + 'complexity': ['error', { max: 10 }], + 'no-console': ['error', { allow: ['warn', 'error', 'info'] }], + 'no-var': ['error'], + 'quotes': ['error', 'single', { 'avoidEscape': true, 'allowTemplateLiterals': true }], + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..1055274 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "@sweetalert2/eslint-config", + "version": "1.0.0", + "description": "ESLint shareable config for the SweetAlert2 JS/TS coding style", + "repository": "sweetalert2/eslint-config", + "author": "Limon Monte (https://limonte.github.io)", + "license": "MIT", + "files": [ + "index.js" + ], + "peerDependencies": { + "eslint": "^6.0.0" + }, + "dependencies": { + "@typescript-eslint/eslint-plugin": "^2.0.0", + "@typescript-eslint/parser": "^2.0.0", + "eslint-config-standard": "^14.0.0", + "eslint-plugin-import": "^2.17.2", + "eslint-plugin-node": "^10.0.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.0" + } +} diff --git a/release.config.js b/release.config.js new file mode 100644 index 0000000..22ddaf8 --- /dev/null +++ b/release.config.js @@ -0,0 +1,21 @@ +module.exports = { + debug: true, + branch: 'master', + verifyConditions: [ + '@semantic-release/changelog', + '@semantic-release/npm', + '@semantic-release/github', + ], + prepare: [ + '@semantic-release/changelog', + '@semantic-release/npm', + '@semantic-release/git', + ], + publish: [ + '@semantic-release/npm', + '@semantic-release/github', + ], + success: [ + '@semantic-release/github', + ] +}