Skip to content

Commit 0204a2d

Browse files
Merge #1696
1696: Remove `.editorconfig` r=curquiza a=flevi29 # Pull Request ## Why? `.editorconfig` was added on the very first commit of this repository, but since then `prettier` has replaced it. Except it wasn't removed. There's no point in having multiple configurations for formatting. Related #1659, in which I wanted to remove all custom options, but didn't know why things still didn't work as they should, and now I know that `prettier` also takes `.editorconfig` into consideration. ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: F. Levi <[email protected]>
2 parents 7699115 + 96ad083 commit 0204a2d

Some content is hidden

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

63 files changed

+2200
-2222
lines changed

.editorconfig

Lines changed: 0 additions & 22 deletions
This file was deleted.

.eslintrc.js

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,77 +5,77 @@ module.exports = {
55
env: { es2022: true, browser: true, node: true },
66
// Standard linting for pure javascript files
77
extends: [
8-
'eslint:recommended',
8+
"eslint:recommended",
99
// Disables all style rules (must always be put last, so it overrides anything before it)
1010
// https://prettier.io/docs/en/integrating-with-linters.html
1111
// https://github.com/prettier/eslint-config-prettier
12-
'prettier',
12+
"prettier",
1313
],
1414
overrides: [
1515
// TypeScript linting for TypeScript files
1616
{
17-
files: '*.ts',
17+
files: "*.ts",
1818
plugins: [
19-
'@typescript-eslint',
19+
"@typescript-eslint",
2020
// https://tsdoc.org/
21-
'eslint-plugin-tsdoc',
21+
"eslint-plugin-tsdoc",
2222
],
23-
parser: '@typescript-eslint/parser',
24-
parserOptions: { project: 'tsconfig.eslint.json' },
23+
parser: "@typescript-eslint/parser",
24+
parserOptions: { project: "tsconfig.eslint.json" },
2525
extends: [
26-
'plugin:@typescript-eslint/recommended-type-checked',
27-
'prettier',
26+
"plugin:@typescript-eslint/recommended-type-checked",
27+
"prettier",
2828
],
2929
rules: {
30-
'tsdoc/syntax': 'error',
30+
"tsdoc/syntax": "error",
3131
// @TODO: Remove the ones between "~~", adapt code
3232
// ~~
33-
'@typescript-eslint/prefer-as-const': 'off',
34-
'@typescript-eslint/ban-ts-comment': 'off',
35-
'@typescript-eslint/no-unsafe-call': 'off',
36-
'@typescript-eslint/no-unsafe-member-access': 'off',
37-
'@typescript-eslint/no-unsafe-return': 'off',
38-
'@typescript-eslint/no-unsafe-assignment': 'off',
39-
'@typescript-eslint/no-unsafe-argument': 'off',
40-
'@typescript-eslint/no-floating-promises': 'off',
33+
"@typescript-eslint/prefer-as-const": "off",
34+
"@typescript-eslint/ban-ts-comment": "off",
35+
"@typescript-eslint/no-unsafe-call": "off",
36+
"@typescript-eslint/no-unsafe-member-access": "off",
37+
"@typescript-eslint/no-unsafe-return": "off",
38+
"@typescript-eslint/no-unsafe-assignment": "off",
39+
"@typescript-eslint/no-unsafe-argument": "off",
40+
"@typescript-eslint/no-floating-promises": "off",
4141
// ~~
42-
'@typescript-eslint/array-type': ['warn', { default: 'array-simple' }],
42+
"@typescript-eslint/array-type": ["warn", { default: "array-simple" }],
4343
// @TODO: Should be careful with this rule, should leave it be and disable
4444
// it within files where necessary with explanations
45-
'@typescript-eslint/no-explicit-any': 'off',
46-
'@typescript-eslint/no-unused-vars': [
47-
'error',
45+
"@typescript-eslint/no-explicit-any": "off",
46+
"@typescript-eslint/no-unused-vars": [
47+
"error",
4848
// argsIgnorePattern: https://eslint.org/docs/latest/rules/no-unused-vars#argsignorepattern
4949
// varsIgnorePattern: https://eslint.org/docs/latest/rules/no-unused-vars#varsignorepattern
50-
{ args: 'all', argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
50+
{ args: "all", argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
5151
],
5252
// @TODO: Not recommended to disable rule, should instead disable locally
5353
// with explanation
54-
'@typescript-eslint/ban-ts-ignore': 'off',
54+
"@typescript-eslint/ban-ts-ignore": "off",
5555
},
5656
},
5757
// Jest linting for test files
5858
{
59-
files: 'tests/*.ts',
60-
plugins: ['jest'],
59+
files: "tests/*.ts",
60+
plugins: ["jest"],
6161
env: {
6262
// @TODO: Jasmine is not meant to be used in Jest tests,
6363
// there's even a rule for it in plugin:jest/recommended
6464
jasmine: true,
6565
jest: true,
66-
'jest/globals': true,
66+
"jest/globals": true,
6767
},
68-
extends: ['plugin:jest/recommended', 'prettier'],
68+
extends: ["plugin:jest/recommended", "prettier"],
6969
// @TODO: Remove all of these rules and adapt code!
7070
rules: {
71-
'jest/no-disabled-tests': 'off',
72-
'jest/expect-expect': 'off',
73-
'jest/no-conditional-expect': 'off',
74-
'jest/valid-title': 'off',
75-
'jest/no-jasmine-globals': 'off',
76-
'jest/valid-expect-in-promise': 'off',
77-
'jest/valid-expect': 'off',
78-
'jest/no-alias-methods': 'off',
71+
"jest/no-disabled-tests": "off",
72+
"jest/expect-expect": "off",
73+
"jest/no-conditional-expect": "off",
74+
"jest/valid-title": "off",
75+
"jest/no-jasmine-globals": "off",
76+
"jest/valid-expect-in-promise": "off",
77+
"jest/valid-expect": "off",
78+
"jest/no-alias-methods": "off",
7979
},
8080
},
8181
],

.prettierrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// https://prettier.io/docs/en/options.html
22

33
module.exports = {
4-
plugins: ['./node_modules/prettier-plugin-jsdoc/dist/index.js'],
4+
plugins: ["./node_modules/prettier-plugin-jsdoc/dist/index.js"],
55
// https://github.com/hosseinmd/prettier-plugin-jsdoc#tsdoc
66
tsdoc: true,
77
};

jest.config.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
/** @type {import('jest').Config} */
1+
/** @type {import("jest").Config} */
22
const config = {
3-
rootDir: '.',
4-
testMatch: ['<rootDir>/tests/**/*.ts?(x)'],
3+
rootDir: ".",
4+
testMatch: ["<rootDir>/tests/**/*.ts?(x)"],
55
verbose: true,
6-
testPathIgnorePatterns: ['meilisearch-test-utils', 'env'],
6+
testPathIgnorePatterns: ["meilisearch-test-utils", "env"],
77
collectCoverage: true,
88
coverageThreshold: {
99
global: {
10-
'ts-jest': {
11-
tsConfig: '<rootDir>/tsconfig.json',
10+
"ts-jest": {
11+
tsConfig: "<rootDir>/tsconfig.json",
1212
},
1313
},
1414
},
1515
watchPlugins: [
16-
'jest-watch-typeahead/filename',
17-
'jest-watch-typeahead/testname',
16+
"jest-watch-typeahead/filename",
17+
"jest-watch-typeahead/testname",
1818
],
1919
projects: [
2020
{
21-
preset: 'ts-jest',
22-
displayName: 'browser',
23-
testEnvironment: 'jsdom',
24-
testMatch: ['<rootDir>/tests/**/*.ts?(x)'],
21+
preset: "ts-jest",
22+
displayName: "browser",
23+
testEnvironment: "jsdom",
24+
testMatch: ["<rootDir>/tests/**/*.ts?(x)"],
2525
testPathIgnorePatterns: [
26-
'meilisearch-test-utils',
27-
'env/',
28-
'token.test.ts',
26+
"meilisearch-test-utils",
27+
"env/",
28+
"token.test.ts",
2929
],
3030
// make sure built-in Node.js fetch doesn't get replaced for consistency
3131
globals: { fetch: global.fetch, AbortController: global.AbortController },
3232
},
3333
{
34-
preset: 'ts-jest',
35-
displayName: 'node',
36-
testEnvironment: 'node',
37-
testMatch: ['<rootDir>/tests/**/*.ts?(x)'],
38-
testPathIgnorePatterns: ['meilisearch-test-utils', 'env/'],
34+
preset: "ts-jest",
35+
displayName: "node",
36+
testEnvironment: "node",
37+
testMatch: ["<rootDir>/tests/**/*.ts?(x)"],
38+
testPathIgnorePatterns: ["meilisearch-test-utils", "env/"],
3939
},
4040
],
4141
};

playgrounds/javascript/src/app.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { MeiliSearch } from '../../../src';
1+
import { MeiliSearch } from "../../../src";
22

33
const config = {
4-
host: 'http://127.0.0.1:7700',
5-
apiKey: 'masterKey',
4+
host: "http://127.0.0.1:7700",
5+
apiKey: "masterKey",
66
};
77

88
const client = new MeiliSearch(config);
9-
const indexUid = 'movies';
9+
const indexUid = "movies";
1010

1111
const addDataset = async () => {
1212
await client.deleteIndex(indexUid);
@@ -16,16 +16,16 @@ const addDataset = async () => {
1616
const documents = await client.index(indexUid).getDocuments();
1717

1818
const dataset = [
19-
{ id: 1, title: 'Carol', genres: ['Romance', 'Drama'] },
20-
{ id: 2, title: 'Wonder Woman', genres: ['Action', 'Adventure'] },
21-
{ id: 3, title: 'Life of Pi', genres: ['Adventure', 'Drama'] },
19+
{ id: 1, title: "Carol", genres: ["Romance", "Drama"] },
20+
{ id: 2, title: "Wonder Woman", genres: ["Action", "Adventure"] },
21+
{ id: 3, title: "Life of Pi", genres: ["Adventure", "Drama"] },
2222
{
2323
id: 4,
24-
title: 'Mad Max: Fury Road',
25-
genres: ['Adventure', 'Science Fiction'],
24+
title: "Mad Max: Fury Road",
25+
genres: ["Adventure", "Science Fiction"],
2626
},
27-
{ id: 5, title: 'Moana', genres: ['Fantasy', 'Action'] },
28-
{ id: 6, title: 'Philadelphia', genres: ['Drama'] },
27+
{ id: 5, title: "Moana", genres: ["Fantasy", "Action"] },
28+
{ id: 6, title: "Philadelphia", genres: ["Drama"] },
2929
];
3030
if (documents.results.length === 0) {
3131
const { taskUid } = await client.index(indexUid).addDocuments(dataset);
@@ -37,24 +37,24 @@ const addDataset = async () => {
3737
try {
3838
await addDataset();
3939
const indexes = await client.getRawIndexes();
40-
document.querySelector('.indexes').innerText = JSON.stringify(
40+
document.querySelector(".indexes").innerText = JSON.stringify(
4141
indexes,
4242
null,
4343
1,
4444
);
45-
const resp = await client.index(indexUid).search('', {
46-
attributesToHighlight: ['title'],
45+
const resp = await client.index(indexUid).search("", {
46+
attributesToHighlight: ["title"],
4747
});
4848
console.log({ resp });
4949
console.log({ hit: resp.hits[0] });
50-
document.querySelector('.hits').innerText = JSON.stringify(
50+
document.querySelector(".hits").innerText = JSON.stringify(
5151
resp.hits.map((hit) => hit.title),
5252
null,
5353
1,
5454
);
55-
document.querySelector('.errors_title').style.display = 'none';
55+
document.querySelector(".errors_title").style.display = "none";
5656
} catch (e) {
5757
console.error(e);
58-
document.querySelector('.errors').innerText = JSON.stringify(e, null, 1);
58+
document.querySelector(".errors").innerText = JSON.stringify(e, null, 1);
5959
}
6060
})();

0 commit comments

Comments
 (0)