Skip to content
This repository was archived by the owner on Dec 30, 2024. It is now read-only.

Commit

Permalink
refactor(project): 🚨 add eslint plugin simple import sort
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbhvn committed Jul 16, 2024
1 parent b4b716b commit 3bc7352
Show file tree
Hide file tree
Showing 59 changed files with 11,062 additions and 1,001 deletions.
9 changes: 6 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
"plugin:prettier/recommended"
],
"parserOptions": {
"ecmaVersion": 2018,
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["simple-import-sort"],
"rules": {
"@typescript-eslint/no-explicit-any": "off"
"@typescript-eslint/no-explicit-any": "off",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error"
}
}
}
46 changes: 28 additions & 18 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";
import path from 'node:path';
import { fileURLToPath } from 'node:url';

import { FlatCompat } from '@eslint/eslintrc';
import js from '@eslint/js';
import tsParser from '@typescript-eslint/parser';
import simpleImportSort from 'eslint-plugin-simple-import-sort';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [{
ignores: ["**/node_modules", "**/bin"],
}, ...compat.extends("plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"), {
export default [
{
ignores: ['**/node_modules', '**/bin']
},
...compat.extends('plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'),
{
languageOptions: {
parser: tsParser,
ecmaVersion: 2018,
sourceType: "module",
parser: tsParser,
ecmaVersion: 2018,
sourceType: 'module'
},

rules: {
"@typescript-eslint/no-explicit-any": "off",
plugins: {
'simple-import-sort': simpleImportSort
},
}];
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error'
}
}
];
Loading

2 comments on commit 3bc7352

@eliasdiek
Copy link

Choose a reason for hiding this comment

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

@0xbhvn hey ,I'm looking for someone with your stack to work on our platform as a freelancer . some projects start soon and others begin in a few months . are you up for it ? contact me on telegram @eliasdiek or via email at [email protected]

@eliasdiek
Copy link

Choose a reason for hiding this comment

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

@0xbhvn we are also hosting a podcast on how to choose a stack to build your web3 project . would you like to participate ?

Please sign in to comment.