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

Upgrade ESLint configs to modules #5176

Merged
merged 3 commits into from
Aug 13, 2024
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
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"eslint.workingDirectories": [
"./clients",
"./clients/admin-ui",
"./clients/fides-js",
"./clients/fidesui",
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ The types of changes are:
- Fixed malformed HTML issue on switch components [#5166](https://github.com/ethyca/fides/pull/5166)
- Fixed a timing issue with tcf/gpp locator iframe naming [#5173](https://github.com/ethyca/fides/pull/5173)

### Developer Experience
- Fixes some ESLint configuration issues [#5176](https://github.com/ethyca/fides/pull/5176)

## [2.42.1](https://github.com/ethyca/fides/compare/2.42.0...2.42.1)

### Fixed
Expand Down
1 change: 1 addition & 0 deletions clients/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/.eslintrc*
41 changes: 21 additions & 20 deletions clients/.eslintrc.json → clients/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"extends": ["airbnb", "airbnb-typescript", "plugin:prettier/recommended"],
"plugins": ["simple-import-sort"],
"root": true,
"rules": {
"curly": ["error", "all"],
module.exports = {
extends: ["airbnb", "airbnb-typescript", "plugin:prettier/recommended"],
plugins: ["simple-import-sort"],
root: true,
rules: {
curly: ["error", "all"],
"nonblock-statement-body-position": ["error", "below"],
"react/function-component-definition": [
2,
{ "namedComponents": "arrow-function" }
{ namedComponents: "arrow-function" },
],
"react/jsx-filename-extension": ["warn", { "extensions": [".tsx"] }],
"react/jsx-key": ["error", { "checkFragmentShorthand": true }],
"react/jsx-filename-extension": ["warn", { extensions: [".tsx"] }],
"react/jsx-key": ["error", { checkFragmentShorthand: true }],
"react/jsx-props-no-spreading": "off",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
Expand All @@ -22,20 +22,21 @@
"no-param-reassign": [
"error",
{
"props": true,
"ignorePropertyModificationsForRegex": ["^draft"]
}
props: true,
ignorePropertyModificationsForRegex: ["^draft"],
},
],
"@typescript-eslint/ban-types": [
"error",
{
"types": {
types: {
"React.FC": {
"message": "Remove entirely and allow Typescript to infer JSX.Element."
}
}
}
message:
"Remove entirely and allow Typescript to infer JSX.Element.",
},
},
},
],
"prettier/prettier": "warn"
}
}
"prettier/prettier": "warn",
},
};
1 change: 0 additions & 1 deletion clients/admin-ui/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ node_modules
dist
out
public/**/*.js
.eslintrc.json
next.config.js
jest.config.js
cypress.config.ts
11 changes: 11 additions & 0 deletions clients/admin-ui/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
extends: ["next/core-web-vitals"],
parserOptions: {
project: "tsconfig.json",
tsconfigRootDir: __dirname,
},
rules: {
// since we are using static site export
"@next/next/no-img-element": "off",
},
};
11 changes: 0 additions & 11 deletions clients/admin-ui/.eslintrc.json

This file was deleted.

13 changes: 13 additions & 0 deletions clients/admin-ui/cypress/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
extends: ["plugin:cypress/recommended"],
plugins: ["no-only-tests", "cypress"],
root: true,
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
},
rules: {
"no-only-tests/no-only-tests": "error",
"cypress/unsafe-to-chain-command": "off",
},
};
12 changes: 0 additions & 12 deletions clients/admin-ui/cypress/.eslintrc.json

This file was deleted.

1 change: 0 additions & 1 deletion clients/fides-js/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules
dist
.eslintrc.json
jest.config.js
rollup.config.mjs
16 changes: 16 additions & 0 deletions clients/fides-js/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
extends: ["preact"],
parserOptions: {
project: "tsconfig.json",
tsconfigRootDir: __dirname,
},
parser: "@typescript-eslint/parser",
rules: {
"import/no-cycle": "off",
"import/extensions": "off",
"react/prop-types": "off",
"no-undef": "off",
"no-unused-vars": "off", // the @typescript-eslint line below is smarter about handling unused variables, taking in to account TS interfaces
"@typescript-eslint/no-unused-vars": ["error", { varsIgnorePattern: "^_" }],
},
};
19 changes: 0 additions & 19 deletions clients/fides-js/.eslintrc.json

This file was deleted.

3 changes: 1 addition & 2 deletions clients/fides-js/src/components/tcf/TcfFeatures.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { h } from "preact";

import { UpdateEnabledIds } from "~/components/tcf/TcfTabs";

import { PrivacyExperience } from "../../lib/consent-types";
import { I18n } from "../../lib/i18n";
import { TCFFeatureRecord, TCFSpecialFeatureRecord } from "../../lib/tcf/types";
import EmbeddedVendorList from "./EmbeddedVendorList";
import RecordsList, { RecordListType } from "./RecordsList";
import { UpdateEnabledIds } from "./TcfTabs";

const FeatureChildren = ({
i18n,
Expand Down
3 changes: 1 addition & 2 deletions clients/fides-js/src/services/api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Locale } from "~/fides";

import {
ComponentType,
ConsentMethod,
Expand All @@ -13,6 +11,7 @@ import {
RecordsServedResponse,
} from "../lib/consent-types";
import { debugLog } from "../lib/consent-utils";
import { Locale } from "../lib/i18n";
import { GVLTranslations } from "../lib/tcf/types";

export enum FidesEndpointPaths {
Expand Down
15 changes: 15 additions & 0 deletions clients/fidesui/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
parser: "@typescript-eslint/parser",
parserOptions: {
project: "tsconfig.json",
tsconfigRootDir: __dirname,
},
rules: {
"import/no-extraneous-dependencies": "off",
"react/react-in-jsx-scope": "off",
},
};
15 changes: 0 additions & 15 deletions clients/fidesui/.eslintrc.json

This file was deleted.

1 change: 0 additions & 1 deletion clients/privacy-center/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ node_modules
dist
out
public/**/*.js
.eslintrc.json
next.config.js
jest.config.js
cypress.config.ts
30 changes: 30 additions & 0 deletions clients/privacy-center/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module.exports = {
extends: ["next/core-web-vitals"],
parserOptions: {
project: "tsconfig.json",
tsconfigRootDir: __dirname,
},
overrides: [
{
// Require Swagger JSdoc for all /api routes
files: ["pages/api/**/*.ts"],
plugins: ["jsdoc"],
rules: {
"jsdoc/no-missing-syntax": [
"error",
{
contexts: [
{
comment: "JsdocBlock:has(JsdocTag[tag=swagger])",
context: "any",
message:
"@swagger documentation is required. See: https://github.com/jellydn/next-swagger-doc",
},
],
},
],
},
},
],
rules: {},
};
29 changes: 0 additions & 29 deletions clients/privacy-center/.eslintrc.json

This file was deleted.

13 changes: 13 additions & 0 deletions clients/privacy-center/cypress/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
extends: ["plugin:cypress/recommended"],
plugins: ["no-only-tests", "cypress"],
root: true,
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
},
rules: {
"no-only-tests/no-only-tests": "error",
"cypress/unsafe-to-chain-command": "off",
},
};
12 changes: 0 additions & 12 deletions clients/privacy-center/cypress/.eslintrc.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ module.exports = {
"prettier",
"next/core-web-vitals",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2022,
sourceType: "module",
project: "tsconfig.json",
tsconfigRootDir: __dirname,
createDefaultProgram: true,
},
root: true,
rules: {
// "curly": ["error", "all"],
Expand All @@ -20,11 +28,4 @@ module.exports = {
],
"react/require-default-props": "off",
},
parserOptions: {
ecmaVersion: 2022,
sourceType: "module",
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
createDefaultProgram: true,
},
};
Loading