-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor ESLint configuration to use TypeScript settings and streamli…
…ne config files
- Loading branch information
Kevin Koech
authored and
Kevin Koech
committed
Jan 9, 2025
1 parent
2cbaa81
commit b492483
Showing
6 changed files
with
42 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,3 @@ | ||
const eslintConfig = require("eslint-config-commons-ui/next"); | ||
const eslintConfig = require("eslint-config-commons-ui/typescript"); | ||
|
||
module.exports = [ | ||
{ | ||
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", | ||
}, | ||
], | ||
}, | ||
}, | ||
]; | ||
module.exports = eslintConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,3 @@ | ||
const eslintConfig = require("eslint-config-commons-ui/next"); | ||
const eslintConfig = require("eslint-config-commons-ui/typescript"); | ||
|
||
module.exports = [ | ||
{ | ||
settings: { | ||
"import/resolver": { | ||
webpack: { | ||
config: "./eslint.webpack.config.js", | ||
}, | ||
typescript: { | ||
alwaysTryTypes: false, | ||
project: "./tsconfig.json", | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
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", | ||
}, | ||
], | ||
}, | ||
}, | ||
...eslintConfig, | ||
]; | ||
module.exports = eslintConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,3 @@ | ||
const eslintConfig = require("eslint-config-commons-ui/next"); | ||
const eslintConfig = require("eslint-config-commons-ui/typescript"); | ||
|
||
module.exports = [ | ||
{ | ||
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", | ||
}, | ||
], | ||
}, | ||
}, | ||
]; | ||
module.exports = eslintConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,3 @@ | ||
const eslintConfig = require("eslint-config-commons-ui/next"); | ||
const eslintConfig = require("eslint-config-commons-ui/typescript"); | ||
|
||
module.exports = [ | ||
{ | ||
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", | ||
}, | ||
], | ||
}, | ||
}, | ||
]; | ||
module.exports = eslintConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const nextConfig = require("./next"); | ||
|
||
module.exports = [ | ||
{ | ||
settings: { | ||
"import/resolver": { | ||
webpack: { | ||
config: "./eslint.webpack.config.js", | ||
}, | ||
typescript: { | ||
alwaysTryTypes: false, | ||
project: "./tsconfig.json", | ||
}, | ||
}, | ||
}, | ||
}, | ||
...nextConfig, | ||
{ | ||
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", | ||
}, | ||
], | ||
}, | ||
}, | ||
]; |