2
0
mirror of https://github.com/iconify/iconify.git synced 2024-11-16 17:45:09 +00:00

chore: fix eslint config and main build script

This commit is contained in:
Vjacheslav Trushkin 2024-11-02 15:39:04 +02:00
parent d0a135fb87
commit c5d1a469d1
3 changed files with 49 additions and 49 deletions

View File

@ -13,8 +13,8 @@
"packageManager": "pnpm@9.12.3", "packageManager": "pnpm@9.12.3",
"scripts": { "scripts": {
"clean": "rm -rf */*/node_modules", "clean": "rm -rf */*/node_modules",
"build": "pnpm recursive --filter \"./(packages|iconify-icon|components)/**\" run build", "build": "pnpm recursive --workspace-concurrency=1 --filter \"./(packages|iconify-icon|components)/**\" run build",
"test": "pnpm recursive --filter \"./(packages|iconify-icon|components)/**\" run test" "test": "pnpm recursive --workspace-concurrency=1 --filter \"./(packages|iconify-icon|components)/**\" run test"
}, },
"devDependencies": {}, "devDependencies": {},
"pnpm": { "pnpm": {

View File

@ -42,10 +42,7 @@ export default [
sourceType: 'commonjs', sourceType: 'commonjs',
parserOptions: { parserOptions: {
tsconfigRootDir:
'/Users/slava/Documents/dev/iconify/iconify/iconify-dev/packages/core',
project: ['tsconfig.json', 'tests/tsconfig.json'], project: ['tsconfig.json', 'tests/tsconfig.json'],
extraFileExtensions: ['.cjs'],
}, },
}, },

View File

@ -1,54 +1,57 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin"; import typescriptEslint from '@typescript-eslint/eslint-plugin';
import globals from "globals"; import globals from 'globals';
import tsParser from "@typescript-eslint/parser"; import tsParser from '@typescript-eslint/parser';
import path from "node:path"; import path from 'node:path';
import { fileURLToPath } from "node:url"; import { fileURLToPath } from 'node:url';
import js from "@eslint/js"; import js from '@eslint/js';
import { FlatCompat } from "@eslint/eslintrc"; import { FlatCompat } from '@eslint/eslintrc';
const __filename = fileURLToPath(import.meta.url); const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename); const __dirname = path.dirname(__filename);
const compat = new FlatCompat({ const compat = new FlatCompat({
baseDirectory: __dirname, baseDirectory: __dirname,
recommendedConfig: js.configs.recommended, recommendedConfig: js.configs.recommended,
allConfig: js.configs.all allConfig: js.configs.all,
}); });
export default [{ export default [
ignores: ["**/lib"], {
}, ...compat.extends( ignores: ['**/lib'],
"eslint:recommended", },
"plugin:@typescript-eslint/recommended", ...compat.extends(
"plugin:@typescript-eslint/recommended-requiring-type-checking", 'eslint:recommended',
"plugin:prettier/recommended", 'plugin:@typescript-eslint/recommended',
), { 'plugin:@typescript-eslint/recommended-requiring-type-checking',
plugins: { 'plugin:prettier/recommended'
"@typescript-eslint": typescriptEslint, ),
}, {
plugins: {
'@typescript-eslint': typescriptEslint,
},
languageOptions: { languageOptions: {
globals: { globals: {
...globals.browser, ...globals.browser,
...globals.node, ...globals.node,
Atomics: "readonly", Atomics: 'readonly',
SharedArrayBuffer: "readonly", SharedArrayBuffer: 'readonly',
}, },
parser: tsParser, parser: tsParser,
ecmaVersion: 5, ecmaVersion: 5,
sourceType: "commonjs", sourceType: 'commonjs',
parserOptions: { parserOptions: {
tsconfigRootDir: "/Users/slava/Documents/dev/iconify/iconify/iconify-dev/packages/utils", project: ['tsconfig.json', 'tests/tsconfig.json'],
project: ["tsconfig.json", "tests/tsconfig.json"], },
extraFileExtensions: [".cjs"], },
},
},
rules: { rules: {
"no-mixed-spaces-and-tabs": ["off"], 'no-mixed-spaces-and-tabs': ['off'],
"no-unused-vars": ["off"], 'no-unused-vars': ['off'],
}, },
}, { },
files: ["src/**/*.ts", "tests/*.ts"], {
}]; files: ['src/**/*.ts', 'tests/*.ts'],
},
];