diff --git a/.eslintrc b/.eslintrc index 9befa521..7d2933ad 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,4 +1,13 @@ { - "plugins": ["@theforeman/foreman"], - "extends": ["plugin:@theforeman/foreman/core", "plugin:@theforeman/foreman/plugins"] -} \ No newline at end of file + "plugins": [ + "@theforeman/foreman", + "@theforeman/rules" + ], + "extends": [ + "plugin:@theforeman/foreman/core", + "plugin:@theforeman/foreman/plugins" + ], + "rules":{ + "@theforeman/rules/require-ouiaid": ["error"] + } +} diff --git a/.github/workflows/js_tests.yml b/.github/workflows/js_tests.yml index 78543f77..83e43053 100644 --- a/.github/workflows/js_tests.yml +++ b/.github/workflows/js_tests.yml @@ -12,6 +12,24 @@ concurrency: cancel-in-progress: true jobs: + lint_custom: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node-version: [14] + steps: + - uses: actions/checkout@v2 + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Npm install + run: | + npm install + - name: Run custom plugin linter + run: | + npm run lint:custom test: name: JavaScript uses: theforeman/actions/.github/workflows/foreman_plugin_js.yml@v0 diff --git a/package.json b/package.json index 11db63ca..00bf1646 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "index.js", "scripts": { "lint": "tfm-lint --plugin -d /webpack", + "lint:custom": "eslint ./webpack", "test": "tfm-test --plugin --config jest.config.js", "test:watch": "tfm-test --plugin --watchAll --config jest.config.js", "test:current": "tfm-test --plugin --watch --config jest.config.js", @@ -28,6 +29,7 @@ "@testing-library/user-event": "^13.2.1", "@theforeman/builder": ">= 10.1.0", "@theforeman/eslint-plugin-foreman": ">= 10.1.0", + "@theforeman/eslint-plugin-rules": ">= 10.1.0", "@theforeman/find-foreman": ">= 10.1.0", "@theforeman/test": ">= 10.1.0", "@theforeman/vendor-dev": ">= 10.1.0", diff --git a/webpack/components/ConfirmModal.js b/webpack/components/ConfirmModal.js index e02bacc0..8a35927a 100644 --- a/webpack/components/ConfirmModal.js +++ b/webpack/components/ConfirmModal.js @@ -11,6 +11,7 @@ const ConfirmModal = props => { const actions = [ ,