Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"packages": [
"packages/*"
],
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "root",
"private": true,
"type": "module",
"scripts": {
"build:all": "yarn workspaces foreach -vp --topological-dev run build",
"lint:all": "yarn workspaces foreach -vp run lint",
Expand All @@ -18,6 +19,8 @@
],
"packageManager": "yarn@3.5.0",
"devDependencies": {
"lerna": "^6.6.2"
"@types/node": "^22.0.0",
"globals": "^16.3.0",
"lerna": "^8.2.2"
}
}
185 changes: 109 additions & 76 deletions packages/eslint-config-convidera/index.js
Original file line number Diff line number Diff line change
@@ -1,86 +1,119 @@
module.exports = {
extends: [
'airbnb-base',
],
env: {
browser: true,
es6: true,
node: true,
import js from '@eslint/js';
import importPlugin from 'eslint-plugin-import';
import { configs } from 'eslint-config-airbnb-extended/legacy';
import globals from 'globals';

export default [
// Base recommended rules
js.configs.recommended,
...configs.base.recommended,

// Import plugin configuration
{
plugins: {
import: importPlugin,
},
rules: {
// Import rules
'import/no-duplicates': 'error',
'import/order': 'error',
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': 'off',
},
},
rules: {
'brace-style': [
'error',
'1tbs',
{
allowSingleLine: false,
},
],
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': 'off',
curly: [
'error',
'all',
],
'array-element-newline': [
'error',
'always',
],

'array-bracket-newline': [
'error',
{
multiline: true,
minItems: 1,
},
],
// Custom rules
{
rules: {
// Code style rules
'brace-style': [
'error',
'1tbs',
{
allowSingleLine: false,
},
],
curly: [
'error',
'all',
],
'linebreak-style': [
'error',
'unix',
],
'arrow-body-style': 'off',
'prefer-destructuring': 'off',

'object-property-newline': [
2,
{
allowAllPropertiesOnSameLine: false,
},
],
'object-curly-newline': [
'error',
{
ObjectExpression: {
// Array and object formatting
'array-element-newline': [
'error',
'always',
],
'array-bracket-newline': [
'error',
{
multiline: true,
minProperties: 1,
minItems: 1,
},
ObjectPattern: {
multiline: true,
minProperties: 1,
],
'object-property-newline': [
'error',
{
allowAllPropertiesOnSameLine: false,
},
ImportDeclaration: {
multiline: true,
minProperties: 1,
],
'object-curly-newline': [
'error',
{
ObjectExpression: {
multiline: true,
minProperties: 1,
},
ObjectPattern: {
multiline: true,
minProperties: 1,
},
ImportDeclaration: {
multiline: true,
minProperties: 1,
},
ExportDeclaration: {
multiline: true,
minProperties: 1,
},
},
ExportDeclaration: {
multiline: true,
minProperties: 1,
],

// Console and logging
'no-console': [
'warn',
{
allow: [
'warn',
'error',
],
},
},
],
'no-console': [
'warn',
{
allow: [
'warn',
'error',
],
},
],
'linebreak-style': [
2,
'unix',
],
'arrow-body-style': 0,
'prefer-destructuring': 0,
],

'no-restricted-syntax': [
'off',
'ForOfStatement',
'ForInStatement',
],
// Syntax restrictions
'no-restricted-syntax': [
'off',
'ForOfStatement',
'ForInStatement',
],
},
},

// Environment configuration
{
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.es2022,
...globals.browser,
...globals.node,
},
},
},
};
];
9 changes: 6 additions & 3 deletions packages/eslint-config-convidera/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
"name": "@convidera-team/eslint-config-convidera",
"version": "1.5.1",
"description": "Eslint config used in Convidera",
"type": "module",
"main": "index.js",
"author": "Convidera",
"license": "ISC",
"files": [
"index.js"
],
"dependencies": {
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.29.1"
"@eslint/compat": "^1.3.2",
"@eslint/js": "^9.34.0",
"eslint-config-airbnb-extended": "^2.2.0",
"eslint-plugin-import": "^2.32.0"
},
"peerDependencies": {
"eslint": ">=8"
"eslint": ">=9"
},
"publishConfig": {
"access": "public"
Expand Down
55 changes: 35 additions & 20 deletions packages/eslint-config-ts-convidera/index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,37 @@
module.exports = {
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
],
extends: [
'@convidera-team/eslint-config-convidera',
'plugin:@typescript-eslint/eslint-recommended',
],
import baseConfig from '@convidera-team/eslint-config-convidera';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';

rules: {
// @see https://github.com/typescript-eslint/typescript-eslint/issues/2471#issuecomment-696609988
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',

'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',

'import/extensions': 'off',
'import/no-unresolved': 'off',
export default [
// Base configuration
...baseConfig,

// TypeScript configuration
{
files: ['**/*.ts', '**/*.tsx', '**/*.mts'],
plugins: {
'@typescript-eslint': tsPlugin,
},
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
},
rules: {
// Disable base rules that conflict with TypeScript
'no-shadow': 'off',
'no-unused-vars': 'off',

// TypeScript-specific rules
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-explicit-any': 'warn',

// Import rules for TypeScript
'import/extensions': 'off',
'import/no-unresolved': 'off',
},
},
};
];
9 changes: 5 additions & 4 deletions packages/eslint-config-ts-convidera/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@convidera-team/eslint-config-ts-convidera",
"version": "1.1.3",
"description": "Eslint typescript config used in Convidera",
"type": "module",
"main": "index.js",
"author": "Convidera",
"license": "ISC",
Expand All @@ -10,12 +11,12 @@
],
"dependencies": {
"@convidera-team/eslint-config-convidera": "^1.5.1",
"@typescript-eslint/eslint-plugin": "^7.7.0",
"@typescript-eslint/parser": "^7.7.0",
"typescript": "^5.4.5"
"@typescript-eslint/eslint-plugin": "^8.41.0",
"@typescript-eslint/parser": "^8.41.0",
"typescript": "^5.9.2"
},
"peerDependencies": {
"eslint": ">=8"
"eslint": ">=9"
},
"publishConfig": {
"access": "public"
Expand Down
Loading