Skip to content

Commit

Permalink
chore: Update eslint config and fix relative imports
Browse files Browse the repository at this point in the history
  • Loading branch information
koechkevin committed Dec 2, 2024
1 parent 65ca9c4 commit 21a2185
Show file tree
Hide file tree
Showing 23 changed files with 85 additions and 502 deletions.
24 changes: 0 additions & 24 deletions apps/charterafrica/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,6 @@
const eslintConfig = require("eslint-config-commons-ui/next");

module.exports = [
{
ignores: [
"**/node_modules",
"**/.pnp",
"**/.pnp.js",
"**/.pnpm-debug.log",
"**/dist/",
"**/coverage",
"**/.next/",
"**/out/",
"**/build/",
"**/.DS_Store",
"**/*.pem",
"**/npm-debug.log*",
"**/yarn-debug.log*",
"**/yarn-error.log*",
"**/.vercel",
"**/.now",
"**/.turbo",
"**/test-results/",
"**/playwright-report/",
"**/public/",
],
},
{
settings: {
"import/resolver": {
Expand Down
48 changes: 11 additions & 37 deletions apps/civicsignalblog/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,19 @@ const eslintConfig = require("eslint-config-commons-ui/next");

module.exports = [
{
ignores: [
"**/node_modules",
"**/.pnp",
"**/.pnp.js",
"**/.pnpm-debug.log",
"**/dist/",
"**/coverage",
"**/.next/",
"**/out/",
"**/build/",
"**/.DS_Store",
"**/*.pem",
"**/npm-debug.log*",
"**/yarn-debug.log*",
"**/yarn-error.log*",
"**/.vercel",
"**/.now",
"**/.turbo",
"**/test-results/",
"**/playwright-report/",
],
},
...eslintConfig.map((config) => {
return {
...config,
settings: {
...config.settings,
"import/resolver": {
webpack: {
config: "./eslint.webpack.config.js",
},
typescript: {
alwaysTryTypes: false,
project: "./tsconfig.json",
},
settings: {
"import/resolver": {
webpack: {
config: "./eslint.webpack.config.js",
},
typescript: {
alwaysTryTypes: false,
project: "./tsconfig.json",
},
},
};
}),
},
},
...eslintConfig,
{
rules: {
"react/jsx-filename-extension": [1, { extensions: [".js", ".tsx"] }], // This rule allows JSX syntax in both .js and tsx files
Expand Down
23 changes: 0 additions & 23 deletions apps/climatemappedafrica/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,6 @@
const eslintConfig = require("eslint-config-commons-ui/next");

module.exports = [
{
ignores: [
"**/node_modules",
"**/.pnp",
"**/.pnp.js",
"**/.pnpm-debug.log",
"**/dist/",
"**/coverage",
"**/.next/",
"**/out/",
"**/build/",
"**/.DS_Store",
"**/*.pem",
"**/npm-debug.log*",
"**/yarn-debug.log*",
"**/yarn-error.log*",
"**/.vercel",
"**/.now",
"**/.turbo",
"**/test-results/",
"**/playwright-report/",
],
},
{
settings: {
"import/resolver": {
Expand Down
23 changes: 0 additions & 23 deletions apps/codeforafrica/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,6 @@
const eslintConfig = require("eslint-config-commons-ui/next");

module.exports = [
{
ignores: [
"**/node_modules",
"**/.pnp",
"**/.pnp.js",
"**/.pnpm-debug.log",
"**/dist/",
"**/coverage",
"**/.next/",
"**/out/",
"**/build/",
"**/.DS_Store",
"**/*.pem",
"**/npm-debug.log*",
"**/yarn-debug.log*",
"**/yarn-error.log*",
"**/.vercel",
"**/.now",
"**/.turbo",
"**/test-results/",
"**/playwright-report/",
],
},
{
settings: {
"import/resolver": {
Expand Down
23 changes: 0 additions & 23 deletions apps/pesayetu/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,6 @@
const eslintConfig = require("eslint-config-commons-ui/next");

module.exports = [
{
ignores: [
"**/node_modules",
"**/.pnp",
"**/.pnp.js",
"**/.pnpm-debug.log",
"**/dist/",
"**/coverage",
"**/.next/",
"**/out/",
"**/build/",
"**/.DS_Store",
"**/*.pem",
"**/npm-debug.log*",
"**/yarn-debug.log*",
"**/yarn-error.log*",
"**/.vercel",
"**/.now",
"**/.turbo",
"**/test-results/",
"**/playwright-report/",
],
},
...eslintConfig,
{
settings: {
Expand Down
23 changes: 0 additions & 23 deletions apps/promisetracker/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,6 @@
const eslintConfig = require("eslint-config-commons-ui/next");

module.exports = [
{
ignores: [
"**/node_modules",
"**/.pnp",
"**/.pnp.js",
"**/.pnpm-debug.log",
"**/dist/",
"**/coverage",
"**/.next/",
"**/out/",
"**/build/",
"**/.DS_Store",
"**/*.pem",
"**/npm-debug.log*",
"**/yarn-debug.log*",
"**/yarn-error.log*",
"**/.vercel",
"**/.now",
"**/.turbo",
"**/test-results/",
"**/playwright-report/",
],
},
{
settings: {
"import/resolver": {
Expand Down
2 changes: 1 addition & 1 deletion apps/promisetracker/src/lib/wp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function wp(site) {
return undefined;
}

// eslint-disable-next-line no-underscore-dangle
/* eslint no-underscore-dangle: off */
const embedded = resource._embedded;

const post = {
Expand Down
2 changes: 1 addition & 1 deletion apps/promisetracker/src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function slugify(string) {
export function groupPromisesByStatus(promises) {
return {
count: promises.length,
/* eslint-disable no-param-reassign */
/* eslint no-param-reassign: "off" */
statusHistory: promises.reduce((promiseByStatus, promise) => {
(promiseByStatus[promise.status.title] =
promiseByStatus[promise.status.title] || []).push(promise);
Expand Down
22 changes: 0 additions & 22 deletions apps/roboshield/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,6 @@
const eslintConfig = require("eslint-config-commons-ui/next");

module.exports = [
{
ignores: [
"**/node_modules",
"**/.pnp",
"**/.pnp.js",
"**/.pnpm-debug.log",
"**/coverage",
"**/.next/",
"**/out/",
"**/build",
"**/.DS_Store",
"**/*.pem",
"**/npm-debug.log*",
"**/yarn-debug.log*",
"**/yarn-error.log*",
"**/.vercel",
"**/.now",
"**/.turbo",
"**/contrib/",
"**/dist/",
],
},
{
settings: {
"import/resolver": {
Expand Down
59 changes: 25 additions & 34 deletions apps/techlabblog/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,31 @@ const eslintConfig = require("eslint-config-commons-ui/next");

module.exports = [
{
ignores: [
"**/node_modules",
"**/.pnp",
"**/.pnp.js",
"**/.pnpm-debug.log",
"**/dist/",
"**/coverage",
"**/.next/",
"**/out/",
"**/build/",
"**/.DS_Store",
"**/*.pem",
"**/npm-debug.log*",
"**/yarn-debug.log*",
"**/yarn-error.log*",
"**/.vercel",
"**/.now",
"**/.turbo",
"**/test-results/",
"**/playwright-report/",
],
},
...eslintConfig.map((config) => {
return {
...config,
settings: {
...config.settings,
"import/resolver": {
typescript: {
alwaysTryTypes: false,
project: "./tsconfig.json",
},
settings: {
"import/resolver": {
webpack: {
config: "./eslint.webpack.config.js",
},
typescript: {
alwaysTryTypes: false,
project: "./tsconfig.json",
},
},
};
}),
},
},
...eslintConfig,
{
rules: {
"react/jsx-filename-extension": [1, { extensions: [".js", ".tsx"] }], // This rule allows JSX syntax in both .js and tsx files
// Disable requirement for importing file extensions for js and tsx files, without this we cant import custom components in Payload
"import/extensions": [
"error",
"ignorePackages",
{
js: "never",
tsx: "never",
},
],
},
},
];
23 changes: 0 additions & 23 deletions apps/uibook/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,6 @@
const eslintConfig = require("eslint-config-commons-ui/next");

module.exports = [
{
ignores: [
"**/node_modules",
"**/.pnp",
"**/.pnp.js",
"**/.pnpm-debug.log",
"**/dist/",
"**/coverage",
"**/.next/",
"**/out/",
"**/build/",
"**/.DS_Store",
"**/*.pem",
"**/npm-debug.log*",
"**/yarn-debug.log*",
"**/yarn-error.log*",
"**/.vercel",
"**/.now",
"**/.turbo",
"**/test-results/",
"**/playwright-report/",
],
},
...eslintConfig,
{
settings: {
Expand Down
Loading

0 comments on commit 21a2185

Please sign in to comment.