Skip to content

Commit ed6f4ba

Browse files
authoredOct 8, 2024··
chore(javascript): use oxlint (#3895)
1 parent cf65d54 commit ed6f4ba

File tree

90 files changed

+287
-517
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+287
-517
lines changed
 

‎.eslintrc.cjs

-139
Original file line numberDiff line numberDiff line change
@@ -79,145 +79,6 @@ module.exports = {
7979
'yml/no-empty-mapping-value': 0,
8080
},
8181
},
82-
{
83-
// es linter
84-
files: ['*.ts', '*.js'],
85-
86-
extends: [
87-
'algolia',
88-
'algolia/typescript',
89-
'plugin:import/errors',
90-
'plugin:import/warnings',
91-
'plugin:import/typescript',
92-
],
93-
94-
env: {
95-
es6: true,
96-
},
97-
98-
parser: '@typescript-eslint/parser',
99-
100-
parserOptions: {
101-
tsconfigRootDir: __dirname,
102-
project: './**/tsconfig.json',
103-
},
104-
105-
settings: {
106-
'import/extensions': ['.js', '.ts'],
107-
'import/parsers': {
108-
'@typescript-eslint/parser': ['.ts'],
109-
},
110-
'import/ignore': ['node_modules'],
111-
},
112-
113-
plugins: ['algolia', 'unused-imports'],
114-
115-
rules: {
116-
// disabled
117-
'no-bitwise': 0,
118-
'max-classes-per-file': 0,
119-
'no-continue': 0,
120-
'@typescript-eslint/prefer-enum-initializers': 0,
121-
'@typescript-eslint/no-namespace': 0,
122-
'import/dynamic-import-chunkname': 0,
123-
124-
'unused-imports/no-unused-imports': 2,
125-
'@typescript-eslint/no-unused-vars': 2,
126-
'@typescript-eslint/consistent-indexed-object-style': 2,
127-
'@typescript-eslint/member-ordering': [
128-
'error',
129-
{
130-
default: [
131-
'protected-instance-method',
132-
'private-instance-method',
133-
'public-instance-method',
134-
],
135-
},
136-
],
137-
'@typescript-eslint/no-restricted-types': [
138-
'error',
139-
{
140-
types: {
141-
String: {
142-
message: 'Use `string` instead.',
143-
fixWith: 'string',
144-
},
145-
Number: {
146-
message: 'Use `number` instead.',
147-
fixWith: 'number',
148-
},
149-
Boolean: {
150-
message: 'Use `boolean` instead.',
151-
fixWith: 'boolean',
152-
},
153-
Symbol: {
154-
message: 'Use `symbol` instead.',
155-
fixWith: 'symbol',
156-
},
157-
Object: {
158-
message:
159-
'The `Object` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead. See https://github.com/typescript-eslint/typescript-eslint/pull/848',
160-
fixWith: 'Record<string, unknown>',
161-
},
162-
'{}': {
163-
message:
164-
'The `{}` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead.',
165-
fixWith: 'Record<string, unknown>',
166-
},
167-
object: {
168-
message:
169-
'The `object` type is hard to use. Use `Record<string, unknown>` instead. See: https://github.com/typescript-eslint/typescript-eslint/pull/848',
170-
fixWith: 'Record<string, unknown>',
171-
},
172-
Function: 'Use a specific function type instead, like `() => void`.',
173-
},
174-
},
175-
],
176-
'jsdoc/match-description': [
177-
'error',
178-
{
179-
matchDescription: '^\n?([A-Z`\[\\d_][\\s\\S]*[.?!`]\\s*)?$'
180-
},
181-
],
182-
},
183-
},
184-
{
185-
files: ['clients/algoliasearch-client-javascript/packages/**/*.ts'],
186-
187-
rules: {
188-
// For a wider browser support (IE>=11), we forbid those two
189-
'no-restricted-syntax': [
190-
'error',
191-
{
192-
selector: "LogicalExpression[operator='??']",
193-
message:
194-
'For wider browser support, nullish coalescing operator is not allowed.',
195-
},
196-
{
197-
selector: 'ChainExpression',
198-
message:
199-
'For wider browser support, optional chaining is not allowed.',
200-
},
201-
],
202-
'@typescript-eslint/prefer-optional-chain': 0,
203-
}
204-
},
205-
{
206-
files: ['clients/algoliasearch-client-javascript/packages/**/__tests__/**/*.ts'],
207-
208-
plugins: ['@vitest/eslint-plugin'],
209-
},
210-
{
211-
files: ['guides/**/*.ts'],
212-
213-
rules: {
214-
'no-console': 0,
215-
216-
// TODO: remove this after https://algolia.atlassian.net/browse/DI-2984
217-
'@typescript-eslint/no-unused-vars': 0,
218-
'@typescript-eslint/explicit-function-return-type': 0,
219-
},
220-
},
22182
{
22283
files: ['*.json'],
22384
parserOptions: {

‎.github/workflows/check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ jobs:
146146
run: yarn scripts:test
147147

148148
- name: Lint custom eslint plugin
149-
run: yarn workspace eslint-plugin-automation-custom lint
149+
run: yarn cli format javascript eslint
150150

151151
- name: Test custom eslint plugin
152152
run: yarn workspace eslint-plugin-automation-custom test

0 commit comments

Comments
 (0)
Please sign in to comment.