Skip to content

Commit

Permalink
update configs to support flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffGreiner-eaton committed Oct 24, 2024
1 parent 2867ac6 commit 3299260
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 44 deletions.
15 changes: 8 additions & 7 deletions eslint-config/blui-rules.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const bluiRules = {
export default {
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'default',
format: ['camelCase'],
format: ['camelCase', 'PascalCase'],
},
{
selector: 'variable',
Expand Down Expand Up @@ -36,11 +36,14 @@ const bluiRules = {
format: ['camelCase'],
leadingUnderscore: 'require',
},

{
selector: 'typeLike',
format: ['PascalCase'],
},
{
selector: 'import',
format: ['camelCase', 'PascalCase'],
},
],
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/explicit-module-boundary-types': ['error', { allowArgumentsExplicitlyTypedAsAny: true }],
Expand Down Expand Up @@ -108,8 +111,6 @@ const bluiRules = {
'prefer-spread': 'error',
'prefer-template': 'error',
'sort-imports': 'off',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"]
};

module.exports = bluiRules;
12 changes: 0 additions & 12 deletions eslint-config/ts.js

This file was deleted.

19 changes: 19 additions & 0 deletions eslint-config/ts.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import js from "@eslint/js";
import tseslint from "typescript-eslint";
import prettierRecommended from "eslint-plugin-prettier/recommended";
import bluiRules from './blui-rules.js'

export default [
js.configs.recommended,
tseslint.configs.eslintRecommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
prettierRecommended,
{
rules: {
'react/prop-types': 'off',
'react/display-name': 'off',
...bluiRules
},
}
];
25 changes: 0 additions & 25 deletions eslint-config/tsx.js

This file was deleted.

30 changes: 30 additions & 0 deletions eslint-config/tsx.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import js from "@eslint/js";
import reactRecommened from "eslint-plugin-react/configs/recommended.js"
import tseslint from "typescript-eslint";
import prettierRecommended from "eslint-plugin-prettier/recommended";
import typescriptEslintParser from "@typescript-eslint/parser";
import bluiRules from './blui-rules.js'

export default [
js.configs.recommended,
tseslint.configs.eslintRecommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
reactRecommened,
prettierRecommended,
{
languageOptions: {
parser: typescriptEslintParser
},
settings: {
react: {
version: 'detect',
},
},
rules: {
'react/prop-types': 'off',
'react/display-name': 'off',
...bluiRules
},
}
];

0 comments on commit 3299260

Please sign in to comment.