mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
refactor: Apply naming-convention rules
This commit is contained in:
27
.eslintrc.js
27
.eslintrc.js
@@ -25,7 +25,6 @@ module.exports = {
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/lines-between-class-members': [ 'error', { exceptAfterSingleLine: true }],
|
||||
'@typescript-eslint/naming-convention': 'off',
|
||||
'@typescript-eslint/no-empty-interface': 'off',
|
||||
'@typescript-eslint/no-invalid-void-type': 'off', // breaks with default void in Asynchandler 2nd generic
|
||||
'@typescript-eslint/no-unnecessary-condition': 'off', // problems with optional parameters
|
||||
@@ -48,6 +47,32 @@ module.exports = {
|
||||
'unicorn/no-fn-reference-in-iterator': 'off', // this prevents some functional programming paradigms
|
||||
'unicorn/no-object-as-default-parameter': 'off',
|
||||
|
||||
// Naming conventions
|
||||
'@typescript-eslint/naming-convention': [
|
||||
'error',
|
||||
{
|
||||
selector: 'default',
|
||||
format: ['camelCase'],
|
||||
leadingUnderscore: 'forbid',
|
||||
trailingUnderscore: 'forbid',
|
||||
},
|
||||
{
|
||||
selector: 'variable',
|
||||
format: ['camelCase', 'UPPER_CASE'],
|
||||
leadingUnderscore: 'forbid',
|
||||
trailingUnderscore: 'forbid',
|
||||
},
|
||||
{
|
||||
selector: 'typeLike',
|
||||
format: ['PascalCase'],
|
||||
},
|
||||
{
|
||||
selector: [ 'typeParameter' ],
|
||||
format: [ 'PascalCase' ],
|
||||
prefix: [ 'T' ]
|
||||
}
|
||||
],
|
||||
|
||||
// Import
|
||||
'sort-imports': 'off', // Disabled in favor of eslint-plugin-import
|
||||
'import/order': ['error', {
|
||||
|
||||
@@ -13,13 +13,13 @@ import { pipeStreamsAndErrors } from './Util';
|
||||
export class MetadataController {
|
||||
/**
|
||||
* Helper function to generate quads for a Container or Resource.
|
||||
* @param URI - The URI for which the quads should be generated.
|
||||
* @param uri - The URI for which the quads should be generated.
|
||||
* @param stats - The Stats of the subject.
|
||||
*
|
||||
* @returns The generated quads.
|
||||
*/
|
||||
public generateResourceQuads(URI: string, stats: Stats): Quad[] {
|
||||
const metadata = new RepresentationMetadata(URI);
|
||||
public generateResourceQuads(uri: string, stats: Stats): Quad[] {
|
||||
const metadata = new RepresentationMetadata(uri);
|
||||
if (stats.isDirectory()) {
|
||||
metadata.add(RDF.type, getNamedNode(LDP.Container));
|
||||
metadata.add(RDF.type, getNamedNode(LDP.BasicContainer));
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
const createSuffixFn = (prefix: string): ((suf: string) => string) => (suffix: string): string => `${prefix}${suffix}`;
|
||||
|
||||
const ACL_PREFIX = createSuffixFn('http://www.w3.org/ns/auth/acl#');
|
||||
|
||||
Reference in New Issue
Block a user