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

Fixes #28460 - adding eslint-plugin-foreman for styling #484

Merged
merged 1 commit into from
Jan 15, 2020
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
28 changes: 2 additions & 26 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,28 +1,4 @@
{
"plugins": ["patternfly-react"],
"extends": [
"plugin:patternfly-react/recommended",
"./node_modules/@theforeman/vendor-dev/eslint.extends.js"
],
"rules": {
"prettier/prettier": [
"error",
{
"singleQuote": true,
"trailingComma": "es5"
}
],
"import/no-unresolved": [
"error",
{
"ignore": ["foremanReact/.*"]
}
],
"import/extensions": [
"error",
{
"ignore": ["foremanReact/.*"]
}
]
}
"plugins": ["@theforeman/foreman"],
"extends": ["plugin:@theforeman/foreman/core", "plugin:@theforeman/foreman/plugins"]
}
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Foreman Tasks =============",
"main": "index.js",
"scripts": {
"lint": "./node_modules/.bin/eslint -c .eslintrc webpack/",
"lint": "tfm-lint --plugin -d /webpack",
"test": "tfm-test --plugin",
"test:watch": "tfm-test --plugin --watchAll",
"test:current": "tfm-test --plugin --watch",
Expand Down Expand Up @@ -32,13 +32,12 @@
"devDependencies": {
"@babel/core": "^7.7.0",
"@theforeman/builder": "^4.0.2",
"@theforeman/eslint-plugin-foreman": "4.0.5",
"@theforeman/stories": "^4.0.2",
"@theforeman/test": "^4.0.2",
"@theforeman/vendor-dev": "^4.0.2",
"babel-eslint": "^10.0.3",
"eslint": "^4.10.0",
"eslint-import-resolver-babel-module": "^5.1.0",
"eslint-plugin-patternfly-react": "0.2.0",
"eslint": "^6.7.2",
"identity-obj-proxy": "^3.0.0",
"jed": "^1.1.1",
"prettier": "^1.13.5",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { testComponentSnapshotsWithFixtures } from '@theforeman/test';;
import { testComponentSnapshotsWithFixtures } from '@theforeman/test';

import { TASKS_DONUT_CHART_FOCUSED_ON_OPTIONS_ARRAY } from './TasksDonutChartConstants';
import TasksDonutChart from './TasksDonutChart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable react-hooks/rules-of-hooks */
Copy link
Member Author

Choose a reason for hiding this comment

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

@sharvit - using hooks outside of a component gives an error, transforming this to WithState solve it

import React, { useState } from 'react';
import { select, action } from '@theforeman/stories';

Expand Down
2 changes: 1 addition & 1 deletion webpack/ForemanTasks/Components/TasksTable/TasksTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const TasksTable = ({

useEffect(() => {
getTableItems(url);
}, [history.location.search]);
}, [getTableItems, url]);

const getSelectionController = () => {
const checkAllRowsSelected = () => results.length === selectedRows.length;
Expand Down