Update rules
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import type { LocalRuleOptions } from '../index';
|
||||
import { error } from '../constants';
|
||||
import type { LocalRuleOptions } from '../index';
|
||||
import { defineMiddleware } from '../middleware';
|
||||
|
||||
const customRules: Partial<LocalRuleOptions> = {
|
||||
|
@ -1,5 +1,7 @@
|
||||
import { type EslintRulesObject } from '@aet/eslint-define-config/src/rules/eslint';
|
||||
import type { EslintRulesObject } from '@aet/eslint-define-config/src/rules/eslint';
|
||||
|
||||
import { error, off, warn } from '../constants';
|
||||
|
||||
import restrictedGlobals from './_restrictedGlobals.json';
|
||||
|
||||
export const eslintRules: Partial<EslintRulesObject> = {
|
||||
|
@ -1,4 +1,5 @@
|
||||
import type { GraphQLRulesObject } from '@aet/eslint-define-config/src/rules/graphql-eslint';
|
||||
|
||||
import { defineMiddleware } from '../middleware';
|
||||
|
||||
// https://the-guild.dev/graphql/eslint/rules
|
||||
|
@ -1,6 +1,7 @@
|
||||
import type { JSDocRulesObject } from '@aet/eslint-define-config/src/rules/jsdoc';
|
||||
import { defineMiddleware } from '../middleware';
|
||||
|
||||
import { off } from '../constants';
|
||||
import { defineMiddleware } from '../middleware';
|
||||
|
||||
const jsdocRules: Partial<JSDocRulesObject> = {
|
||||
'jsdoc/require-jsdoc': off,
|
||||
|
@ -1,5 +1,6 @@
|
||||
import type { ReactRulesObject } from '@aet/eslint-define-config/src/rules/react';
|
||||
import type { ReactRefreshRulesObject } from '@aet/eslint-define-config/src/rules/react-refresh';
|
||||
|
||||
import { error, off, warn } from '../constants';
|
||||
import { defineMiddleware } from '../middleware';
|
||||
|
||||
|
@ -1,9 +1,10 @@
|
||||
import { error } from '../constants';
|
||||
import { defineMiddleware } from '../middleware';
|
||||
import type { StylisticRulesObject } from '@aet/eslint-define-config/src/rules/stylistic';
|
||||
|
||||
import { error } from '../constants';
|
||||
import { defineMiddleware } from '../middleware';
|
||||
|
||||
const stylisticRules: Partial<StylisticRulesObject> = {
|
||||
'stylistic/spaced-comment': [
|
||||
'@stylistic/spaced-comment': [
|
||||
error,
|
||||
'always',
|
||||
{
|
||||
@ -14,6 +15,7 @@ const stylisticRules: Partial<StylisticRulesObject> = {
|
||||
],
|
||||
};
|
||||
|
||||
export const stylistic = defineMiddleware((_, { addRules }) => {
|
||||
export const stylistic = defineMiddleware((config, { addRules }) => {
|
||||
config.plugins.push('@stylistic');
|
||||
addRules(stylisticRules);
|
||||
});
|
||||
|
@ -1,6 +1,7 @@
|
||||
import type { TailwindRulesObject } from '@aet/eslint-define-config/src/rules/tailwind';
|
||||
import { defineMiddleware } from '../middleware';
|
||||
|
||||
import { off } from '../constants';
|
||||
import { defineMiddleware } from '../middleware';
|
||||
|
||||
const tailwindRules: Partial<TailwindRulesObject> = {
|
||||
'tailwindcss/no-custom-classname': off,
|
||||
|
@ -1,4 +1,5 @@
|
||||
import type { TestingLibraryRulesObject } from '@aet/eslint-define-config/src/rules/testing-library';
|
||||
|
||||
import { defineMiddleware } from '../middleware';
|
||||
|
||||
const testingLibraryRules: Partial<TestingLibraryRulesObject> = {};
|
||||
|
@ -1,12 +1,32 @@
|
||||
import { error, off, warn } from '../constants';
|
||||
import type { TypeScriptRulesObject } from '@aet/eslint-define-config/src/rules/typescript-eslint';
|
||||
import type { ImportXRulesObject } from '@aet/eslint-define-config/src/rules/import-x';
|
||||
import type { TypeScriptRulesObject } from '@aet/eslint-define-config/src/rules/typescript-eslint';
|
||||
|
||||
import { error, off, warn } from '../constants';
|
||||
import { defineMiddleware } from '../middleware';
|
||||
|
||||
const importRules: Partial<ImportXRulesObject> = {
|
||||
'import-x/export': off,
|
||||
'import-x/first': error,
|
||||
'import-x/no-absolute-path': error,
|
||||
'import-x/no-duplicates': error,
|
||||
'import-x/order': [error, { groups: ['builtin', 'external'] }],
|
||||
'import-x/no-useless-path-segments': error,
|
||||
'import-x/order': [
|
||||
error,
|
||||
{
|
||||
groups: [
|
||||
'builtin',
|
||||
'external',
|
||||
'internal',
|
||||
'parent',
|
||||
'sibling',
|
||||
'index',
|
||||
'object',
|
||||
'type',
|
||||
],
|
||||
'newlines-between': 'always-and-inside-groups',
|
||||
alphabetize: { order: 'asc', caseInsensitive: true },
|
||||
},
|
||||
],
|
||||
'import-x/unambiguous': error,
|
||||
};
|
||||
|
||||
const typescriptRules: Partial<TypeScriptRulesObject> = {
|
||||
@ -66,8 +86,8 @@ export const importTypeScript = defineMiddleware((config, { addRules, addSetting
|
||||
files: ['.eslintrc.js', '.eslintrc.cjs', '*.config.js', 'index.js'],
|
||||
extends: ['plugin:@typescript-eslint/disable-type-checked'],
|
||||
rules: {
|
||||
'@typescript-eslint/no-require-imports': off,
|
||||
'import-x/no-commonjs': off,
|
||||
'@typescript-eslint/no-require-imports': off,
|
||||
'rules/restrict-template-expressions': off,
|
||||
},
|
||||
},
|
||||
|
@ -1,7 +1,8 @@
|
||||
/* eslint-disable unicorn/string-content */
|
||||
import type { UnicornRulesObject } from '@aet/eslint-define-config/src/rules/unicorn';
|
||||
import { defineMiddleware } from '../middleware';
|
||||
|
||||
import { error, warn } from '../constants';
|
||||
import { defineMiddleware } from '../middleware';
|
||||
|
||||
const suggest = (suggest: string) => ({ suggest, fix: false });
|
||||
|
||||
@ -85,6 +86,10 @@ const unicornRules: Partial<UnicornRulesObject> = {
|
||||
'<=>': suggest('⇔'),
|
||||
'\\.\\.\\.': suggest('…'),
|
||||
"'s ": suggest('’s '),
|
||||
"l'": suggest('l’'),
|
||||
"d'": suggest('d’'),
|
||||
'?!': suggest('⁈'),
|
||||
'!?': suggest('⁉'),
|
||||
},
|
||||
},
|
||||
],
|
||||
|
Reference in New Issue
Block a user