algolia / algoliasearch-zendesk

Integrate Algolia within your Zendesk Help Center in minutes.
https://community.algolia.com/zendesk
Other
21 stars 12 forks source link

fix: upgrade linting #159

Closed sbellone closed 2 years ago

sbellone commented 2 years ago

DI-263

Linting has been failing with the following errors:

1:1  error    Definition for rule 'algolia/relative-require' was not found   algolia/relative-require
1:1  error    Definition for rule 'algolia/force-import-root' was not found  algolia/force-import-root
1:1  warning  Definition for rule 'algolia/no-require' was not found         algolia/no-require
1:1  error    Definition for rule 'algolia/no-module-exports' was not found  algolia/no-module-exports

This is because those rules have been removed a while ago (https://github.com/algolia/eslint-plugin-algolia/commit/84ed194ddd4aabbbe8b109c9d28b1afc293d1d6d) and even though we were referencing eslint-plugin-algolia: 1.5.0 there was probably some dependencies issues in eslint-config-algolia.

We are stuck on Node 10 for now so I had a hard time finding the right balance, but in the end I've been able to upgrade almost all lint-related libraries to their latest version, except:

gulp-lint hasn't been updated in the last years so I haven't been able to make gulp lint work. Switched to calling eslint directly.

After that, I ran: npx eslint . --fix And I finally fixed the remaining linting errors (import/extensions, import/no-unresolved, ...) or disabled the rules.

How to test

npm run lint

sbellone commented 2 years ago

Node modules compilation errors

../src/create_string.cpp: In function ‘char* create_string(Nan::MaybeLocal<v8::Value>)’:
../src/create_string.cpp:17:37: error: no matching function for call to ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>&)’
   17 |   v8::String::Utf8Value string(value);
      |                                     ^
In file included from ~/.node-gyp/12.22.12/include/node/node.h:67,
                 from ../../nan/nan.h:56,
                 from ../src/create_string.cpp:1: